[yocto] [PATCH 05/10][auh] upgradehelper.py: Add own step for loading environment

Paul Eggleton paul.eggleton at linux.intel.com
Fri Jul 31 06:48:01 PDT 2015


On Wednesday 29 July 2015 15:50:48 Aníbal Limón wrote:
> Instead of load environment in detecting git repository use own
> function making easy to debug.

The changes here don't seem to entirely match up with the commit message.

> Signed-off-by: Aníbal Limón <anibal.limon at linux.intel.com>
> ---
>  upgradehelper.py | 11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/upgradehelper.py b/upgradehelper.py
> index 13fc7dd..9119cb0 100755
> --- a/upgradehelper.py
> +++ b/upgradehelper.py
> @@ -147,6 +147,7 @@ class Updater(object):
> 
>          self.upgrade_steps = [
>              (self._create_workdir, None),
> +            (self._get_env, "Loading environment ..."),
>              (self._detect_repo, "Detecting git repository location ..."),
>              (self._clean_repo, "Cleaning git repository of temporary branch
> ..."), (self._detect_recipe_type, None),
> @@ -205,18 +206,16 @@ class Updater(object):
>                  os.remove(os.path.join(self.workdir, f))
> 
>      def _detect_repo(self):
> -        self._get_env()
> -
> -        if self.env['PV'] == self.new_ver:
> +        if self.env['PKGV'] == self.new_ver:
>              raise UpgradeNotNeededError
> 
> -        if self.git is not None:
> +        # UniverseUpdater use git poky respository
> +        if isinstance(self.git, UniverseUpdater):
>              return
> 
>          self.git = Git(self.recipe_dir)
> 
>          stdout = self.git.status()
> -
>          if stdout != "":
>              if self.interactive:
>                  W(" %s: git repository has uncommited work which will be
> dropped! Proceed? (y/N)" % self.pn) @@ -527,6 +526,8 @@ class
> Updater(object):
>  class UniverseUpdater(Updater):
>      def __init__(self):
>          Updater.__init__(self, True, True)
> +
> +        # XXX: assume that the poky directory is the first entry in the
> PATH self.git = Git(os.path.dirname(os.getenv('PATH',
> False).split(':')[0]))
> 
>          # read history file

-- 

Paul Eggleton
Intel Open Source Technology Centre



More information about the yocto mailing list