]> code.ossystems Code Review - openembedded-core.git/commitdiff
classes/buildhistory: do not save old packagehistory files by default
authorPaul Eggleton <paul.eggleton@linux.intel.com>
Mon, 5 Dec 2011 18:28:12 +0000 (18:28 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 5 Dec 2011 22:42:48 +0000 (22:42 +0000)
Disable storing package history as version named files unless
BUILDHISTORY_KEEP_VERSIONS is set to 1; otherwise the adds of these
files that duplicate what is already in git anyway is just noise in the
git log.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/buildhistory.bbclass

index 1859961012410aed4cadcfeb5e0259dfd7841833..e4534e9fbeb630ad42432da9b3cb3b8fee4fed37 100644 (file)
@@ -258,8 +258,13 @@ def write_latestlink(pkg, pe, pv, pr, d):
                filedir = os.path.join(pkghistdir, pkg)
        else:
                filedir = pkghistdir
-       rm_link(os.path.join(filedir, "latest"))
-       shutil.copy(os.path.join(filedir, "%s:%s-%s" % (pe, pv, pr)), os.path.join(filedir, "latest"))
+       latest_file = os.path.join(filedir, "latest")
+       ver_file = os.path.join(filedir, "%s:%s-%s" % (pe, pv, pr))
+       rm_link(latest_file)
+       if d.getVar('BUILDHISTORY_KEEP_VERSIONS', True) == '1':
+               shutil.copy(ver_file, latest_file)
+       else:
+               shutil.move(ver_file, latest_file)
 
 
 buildhistory_get_image_installed() {