* [[PATCH][AUH] 1/2] buildhistory.py: Add the ability for generate full and simple output.
@ 2016-01-13 21:52 Aníbal Limón
2016-01-13 21:52 ` [[PATCH][AUH] 2/2] steps.py: Adds {pack, unpack}_original_workdir Aníbal Limón
0 siblings, 1 reply; 2+ messages in thread
From: Aníbal Limón @ 2016-01-13 21:52 UTC (permalink / raw)
To: yocto; +Cc: paul.eggleton
Now buildhistroy generate two diff files,
- buildhistory-diff.txt: Simple diff generated without -a
option.
- buildhistory-diff-full.txt: Full diff generated contains
all the packages including -dbg and -dev.
Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
---
modules/buildhistory.py | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/modules/buildhistory.py b/modules/buildhistory.py
index d8ca46d..9085233 100644
--- a/modules/buildhistory.py
+++ b/modules/buildhistory.py
@@ -61,15 +61,21 @@ class BuildHistory(object):
rev_initial = self.revs[0]
rev_final = self.revs[-1]
- cmd = "buildhistory-diff -a -p %s %s %s" % (self.buildhistory_dir,
- rev_initial, rev_final)
-
try:
+ cmd = "buildhistory-diff -p %s %s %s" % (self.buildhistory_dir,
+ rev_initial, rev_final)
stdout, stderr = bb.process.run(cmd)
-
if stdout and os.path.exists(self.workdir):
with open(os.path.join(self.workdir, "buildhistory-diff.txt"),
"w+") as log:
log.write(stdout)
+
+ cmd_full = "buildhistory-diff -a -p %s %s %s" % (self.buildhistory_dir,
+ rev_initial, rev_final)
+ stdout, stderr = bb.process.run(cmd_full)
+ if stdout and os.path.exists(self.workdir):
+ with open(os.path.join(self.workdir, "buildhistory-diff-full.txt"),
+ "w+") as log:
+ log.write(stdout)
except bb.process.ExecutionError as e:
W( "%s: Buildhistory checking fails\n%s" % (self.pn, e.stdout))
--
2.1.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [[PATCH][AUH] 2/2] steps.py: Adds {pack, unpack}_original_workdir.
2016-01-13 21:52 [[PATCH][AUH] 1/2] buildhistory.py: Add the ability for generate full and simple output Aníbal Limón
@ 2016-01-13 21:52 ` Aníbal Limón
0 siblings, 0 replies; 2+ messages in thread
From: Aníbal Limón @ 2016-01-13 21:52 UTC (permalink / raw)
To: yocto; +Cc: paul.eggleton
The original workdir directory is needed for make diff's for example
when license change [1], in order to avoid deletion of original workdir
when recipe is upgraded.
Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
[1] https://lists.yoctoproject.org/pipermail/yocto/2016-January/028025.html
Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
---
modules/steps.py | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/modules/steps.py b/modules/steps.py
index 2685b80..0c527a4 100644
--- a/modules/steps.py
+++ b/modules/steps.py
@@ -20,6 +20,7 @@
import os
import sys
+import subprocess
from logging import debug as D
from logging import info as I
@@ -99,6 +100,19 @@ def buildhistory_init(bb, git, opts, pkg_ctx):
def unpack_original(bb, git, opts, pkg_ctx):
pkg_ctx['recipe'].unpack()
+def pack_original_workdir(bb, git, opts, pkg_ctx):
+ recipe_workdir = os.path.dirname(pkg_ctx['env']['S'])
+ pkg_ctx['recipe_workdir_tarball'] = os.path.join(pkg_ctx['workdir'],
+ 'original_workdir.tar.gz')
+
+ try:
+ subprocess.call(["tar", "-chzf", pkg_ctx['recipe_workdir_tarball'],
+ recipe_workdir], stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE)
+ except:
+ W(" %s, Can't compress original workdir, if license diff" \
+ " is needed will show full file." % pkg_ctx['PN'])
+
def rename(bb, git, opts, pkg_ctx):
pkg_ctx['recipe'].rename()
@@ -112,6 +126,15 @@ def cleanall(bb, git, opts, pkg_ctx):
def fetch(bb, git, opts, pkg_ctx):
pkg_ctx['recipe'].fetch()
+def unpack_original_workdir(bb, git, opts, pkg_ctx):
+ try:
+ subprocess.call(["tar", "-xhzf", pkg_ctx['recipe_workdir_tarball'],
+ "-C", "/"], stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE)
+ os.unlink(pkg_ctx['recipe_workdir_tarball'])
+ except:
+ pass
+
def compile(bb, git, opts, pkg_ctx):
if opts['skip_compilation']:
W(" %s: Compilation was skipped by user choice!")
@@ -136,9 +159,11 @@ upgrade_steps = [
(detect_recipe_type, None),
(buildhistory_init, None),
(unpack_original, "Fetch & unpack original version ..."),
+ (pack_original_workdir, None),
(rename, "Renaming recipes, reset PR (if exists) ..."),
(cleanall, "Clean all ..."),
(fetch, "Fetch new version (old checksums) ..."),
+ (unpack_original_workdir, None),
(compile, None),
(buildhistory_diff, None)
]
--
2.1.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-01-13 21:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-13 21:52 [[PATCH][AUH] 1/2] buildhistory.py: Add the ability for generate full and simple output Aníbal Limón
2016-01-13 21:52 ` [[PATCH][AUH] 2/2] steps.py: Adds {pack, unpack}_original_workdir Aníbal Limón
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.