aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/buildhistory-diff
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2012-01-05 14:46:25 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-01-06 11:27:26 +0000
commit5e5cbb9bd8cdce402b979680288ac8c51799a24d (patch)
tree2586bd29962dcbe10e70b31103c7ae4fe267d3be /scripts/buildhistory-diff
parent70dc38b1e127524f50f661c5dd4b3225ddb0b36b (diff)
downloadopenembedded-core-contrib-5e5cbb9bd8cdce402b979680288ac8c51799a24d.tar.gz
buildhistory: add script to check for significant changes
Adds a buildhistory-diff script which can be used to analyse changes in the buildhistory git repository (as produced by buildhistory.bbclass), and report significant ones that may need manual checking to ensure they aren't regressions (e.g. package size changed by more than a certain percentage, files added/removed/changed in the image, etc.) The implementation is actually split into a small script and a Python module, in order to make the logic re-usable in a future web-based interface. Implements the first part of [YOCTO #1566]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Diffstat (limited to 'scripts/buildhistory-diff')
-rwxr-xr-xscripts/buildhistory-diff43
1 files changed, 43 insertions, 0 deletions
diff --git a/scripts/buildhistory-diff b/scripts/buildhistory-diff
new file mode 100755
index 0000000000..6b344ebfaf
--- /dev/null
+++ b/scripts/buildhistory-diff
@@ -0,0 +1,43 @@
+#!/usr/bin/env python
+
+# Report significant differences in the buildhistory repository since a specific revision
+#
+# Copyright (C) 2012 Intel Corporation
+# Author: Paul Eggleton <paul.eggleton@linux.intel.com>
+
+import sys
+import os.path
+
+# Ensure PythonGit is installed (buildhistory_analysis needs it)
+try:
+ import git
+except ImportError:
+ print("Please install PythonGit 0.3.1 or later in order to use this script")
+ sys.exit(1)
+
+
+def main():
+ if (len(sys.argv) < 3):
+ print("Report significant differences in the buildhistory repository")
+ print("Syntax: %s <buildhistory-path> <since-revision> [to-revision]" % os.path.basename(sys.argv[0]))
+ print("If to-revision is not specified, it defaults to HEAD")
+ sys.exit(1)
+
+ # Set path to OE lib dir so we can import the buildhistory_analysis module
+ newpath = os.path.abspath(os.path.dirname(os.path.abspath(sys.argv[0])) + '/../meta/lib')
+ sys.path = sys.path + [newpath]
+ import oe.buildhistory_analysis
+
+ if len(sys.argv) > 3:
+ torev = sys.argv[3]
+ else:
+ torev = 'HEAD'
+ changes = oe.buildhistory_analysis.process_changes(sys.argv[1], sys.argv[2], torev)
+ for chg in changes:
+ print('%s' % chg)
+
+ sys.exit(0)
+
+
+if __name__ == "__main__":
+ main()