From: "Aníbal Limón" <anibal.limon@linux.intel.com>
To: yocto@yoctoproject.org
Cc: paul.eggleton@linux.intel.com
Subject: [PATCH 07/10][AUH] upgradehelper.py: Improve work directory structure
Date: Mon, 9 Nov 2015 16:01:38 -0600 [thread overview]
Message-ID: <1447106501-470-8-git-send-email-anibal.limon@linux.intel.com> (raw)
In-Reply-To: <1447106501-470-1-git-send-email-anibal.limon@linux.intel.com>
Add work directory with datetime suffix to preserve recipe upgrades.
Create tree folders all, succeed and failed,
all - Contains all the recipes work
succeed - Contains a symlinks to the recipes that successful
upgrade
failed - Contains a symlinks to the recipes that fail
upgrade
This helps to navigate over patches that have a successful upgrade.
Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
---
upgradehelper.py | 24 +++++++++++++++++-------
1 file changed, 17 insertions(+), 7 deletions(-)
diff --git a/upgradehelper.py b/upgradehelper.py
index ae40fb1..aeb9cf1 100755
--- a/upgradehelper.py
+++ b/upgradehelper.py
@@ -132,9 +132,16 @@ class Updater(object):
if not os.path.exists(self.uh_dir):
os.mkdir(self.uh_dir)
- self.uh_work_dir = os.path.join(self.uh_dir, "work")
- if not os.path.exists(self.uh_work_dir):
- os.mkdir(self.uh_work_dir)
+ self.uh_work_dir = os.path.join(self.uh_dir, "work-%s" % \
+ datetime.now().strftime("%Y%m%d%H%M"))
+ os.mkdir(self.uh_work_dir)
+
+ self.uh_recipes_all_dir = os.path.join(self.uh_work_dir, "all")
+ os.mkdir(self.uh_recipes_all_dir)
+ self.uh_recipes_succeed_dir = os.path.join(self.uh_work_dir, "succeed")
+ os.mkdir(self.uh_recipes_succeed_dir)
+ self.uh_recipes_failed_dir = os.path.join(self.uh_work_dir, "failed")
+ os.mkdir(self.uh_recipes_failed_dir)
self.bb = Bitbake(get_build_dir())
self.git = None
@@ -223,10 +230,7 @@ class Updater(object):
self.env = self._get_env(self.pn)
def _create_workdir(self):
- self.workdir = os.path.join(self.uh_work_dir, self.pn)
-
- if os.path.exists(self.workdir):
- shutil.rmtree(self.workdir)
+ self.workdir = os.path.join(self.uh_recipes_all_dir, self.pn)
os.mkdir(self.workdir)
def _detect_repo(self):
@@ -490,6 +494,9 @@ class Updater(object):
I(" %s: %s" % (self.pn, msg))
step()
+ os.symlink(self.workdir, os.path.join( \
+ self.uh_recipes_succeed_dir, self.pn))
+
I(" %s: Upgrade SUCCESSFUL! Please test!" % self.pn)
except Exception as e:
if isinstance(e, UpgradeNotNeededError):
@@ -511,6 +518,9 @@ class Updater(object):
error = e
+ os.symlink(self.workdir, os.path.join( \
+ self.uh_recipes_failed_dir, self.pn))
+
self._commit_changes()
self.pkg_upgrade_handler(error)
--
2.1.4
next prev parent reply other threads:[~2015-11-09 22:01 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-09 22:01 [PATCH 00/10][AUH] Improvements and small fixes Aníbal Limón
2015-11-09 22:01 ` [PATCH 01/10][AUH] upgradehelper.py: Add step for build gcc-runtime at init Aníbal Limón
2015-11-09 22:01 ` [PATCH 02/10][AUH] upgradehelper.py: Fix bug when buildhistory isn't enabled Aníbal Limón
2015-11-09 22:01 ` [PATCH 03/10][AUH] recipe.py: Improvements and refactor of fetch method Aníbal Limón
2015-11-10 8:46 ` Paul Eggleton
2015-11-11 20:08 ` Aníbal Limón
2015-11-09 22:01 ` [PATCH 04/10][AUH] buildhistory.py: Don't modify BB_ENV_EXTRAWHITE before init Aníbal Limón
2015-11-10 8:54 ` Paul Eggleton
2015-11-11 20:14 ` Aníbal Limón
2015-11-09 22:01 ` [PATCH 05/10][AUH] upgradehelper.py: Add sanity test for ensure that git is configured Aníbal Limón
2015-11-10 8:59 ` Paul Eggleton
2015-11-11 20:15 ` Aníbal Limón
2015-11-09 22:01 ` [PATCH 06/10][AUH] buildhistory.py: Add missing warning import. git.py: Fix last_commit method Aníbal Limón
2015-11-09 22:01 ` Aníbal Limón [this message]
2015-11-09 22:01 ` [PATCH 08/10][AUH] upgradehelper.py: Add support for do recipe upgrades based on builddep Aníbal Limón
2015-11-10 9:09 ` Paul Eggleton
2015-11-11 20:15 ` Aníbal Limón
2015-11-09 22:01 ` [PATCH 09/10][AUH] upgradehelper.py: Add support for preserve statistics into work directory Aníbal Limón
2015-11-09 22:01 ` [PATCH 10/10][AUH] requirements.txt: Add file for now only with GitPython Aníbal Limón
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=1447106501-470-8-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.