From: Paul Eggleton Date: Mon, 5 Dec 2011 18:28:12 +0000 (+0000) Subject: classes/buildhistory: do not save old packagehistory files by default X-Git-Tag: lucaceresoli/bug-15201-perf-libtraceevent-missing~43349 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fd2581770b8e4c42aa88f244daca58e27e11dff9;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git classes/buildhistory: do not save old packagehistory files by default 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 Signed-off-by: Richard Purdie --- diff --git a/meta/classes/buildhistory.bbclass b/meta/classes/buildhistory.bbclass index 18599610124..e4534e9fbeb 100644 --- a/meta/classes/buildhistory.bbclass +++ b/meta/classes/buildhistory.bbclass @@ -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() {