All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Aníbal Limón" <anibal.limon@linux.intel.com>
To: yocto@yoctoproject.org
Cc: paul.eggleton@linux.intel.com
Subject: [PATCH 05/10][auh] upgradehelper.py: Add own step for loading environment
Date: Wed, 29 Jul 2015 15:50:48 -0500	[thread overview]
Message-ID: <1438203053-7909-6-git-send-email-anibal.limon@linux.intel.com> (raw)
In-Reply-To: <1438203053-7909-1-git-send-email-anibal.limon@linux.intel.com>

Instead of load environment in detecting git repository use own
function making easy to debug.

Signed-off-by: Aníbal Limón <anibal.limon@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
-- 
1.9.1



  parent reply	other threads:[~2015-07-29 20:51 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-29 20:50 [PATCH 00/10][auh] Add support for buildhistory and minor fixes Aníbal Limón
2015-07-29 20:50 ` [PATCH 01/10][auh] upgradehelper.py: Only run with one recipe or all Aníbal Limón
2015-07-31 13:48   ` Paul Eggleton
2015-07-29 20:50 ` [PATCH 02/10][auh] upgradehelper.py: Validate if upgrade is needed Aníbal Limón
2015-07-29 20:50 ` [PATCH 03/10][auh] upgradehelper.py: Only send emails when patch file exist Aníbal Limón
2015-07-29 20:50 ` [PATCH 04/10][auh] bitbake.py: Improve performance on env() call Aníbal Limón
2015-07-29 20:50 ` Aníbal Limón [this message]
2015-07-31 13:48   ` [PATCH 05/10][auh] upgradehelper.py: Add own step for loading environment Paul Eggleton
2015-07-29 20:50 ` [PATCH 06/10][auh] upgradehelper.py: UniverseUpdate don't abort if recipe checkpkg fails Aníbal Limón
2015-07-29 20:50 ` [PATCH 07/10][auh] bitbake.py: Rename bitbake_log.txt to bitbake_error_log Aníbal Limón
2015-07-29 20:50 ` [PATCH 08/10][auh] upgradehelper.py: Remove unused references to Buildhistory class Aníbal Limón
2015-07-29 20:50 ` [PATCH 09/10][auh] upgradehelper.py: Move upstream versioning code to UniverseUpdater Aníbal Limón
2015-07-29 20:50 ` [PATCH 10/10][auh] upgradehelper: Add support for generate buildhistory recipe diff's Aníbal Limón
2015-07-31 15:29   ` Paul Eggleton
2015-07-31 15:39     ` Aníbal Limón
2015-07-31 16:10       ` Paul Eggleton
2015-07-31 16:19         ` Aníbal Limón
2015-07-31 16:21           ` Paul Eggleton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1438203053-7909-6-git-send-email-anibal.limon@linux.intel.com \
    --to=anibal.limon@linux.intel.com \
    --cc=paul.eggleton@linux.intel.com \
    --cc=yocto@yoctoproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.