diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2012-01-05 14:46:25 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-01-06 12:11:30 +0000 |
commit | fcc5f6883c5913d85a98349411ea394045e1f52d (patch) | |
tree | 441af80ec5b9648d83f093e4478d896c8bca0d26 /scripts/buildhistory-diff | |
parent | f22c29226169e6f7cade67cf48f0ac67c1ae4822 (diff) | |
download | poky-fcc5f6883c5913d85a98349411ea394045e1f52d.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].
(From OE-Core rev: 5e5cbb9bd8cdce402b979680288ac8c51799a24d)
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/buildhistory-diff')
-rwxr-xr-x | scripts/buildhistory-diff | 43 |
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 @@ | |||
1 | #!/usr/bin/env python | ||
2 | |||
3 | # Report significant differences in the buildhistory repository since a specific revision | ||
4 | # | ||
5 | # Copyright (C) 2012 Intel Corporation | ||
6 | # Author: Paul Eggleton <paul.eggleton@linux.intel.com> | ||
7 | |||
8 | import sys | ||
9 | import os.path | ||
10 | |||
11 | # Ensure PythonGit is installed (buildhistory_analysis needs it) | ||
12 | try: | ||
13 | import git | ||
14 | except ImportError: | ||
15 | print("Please install PythonGit 0.3.1 or later in order to use this script") | ||
16 | sys.exit(1) | ||
17 | |||
18 | |||
19 | def main(): | ||
20 | if (len(sys.argv) < 3): | ||
21 | print("Report significant differences in the buildhistory repository") | ||
22 | print("Syntax: %s <buildhistory-path> <since-revision> [to-revision]" % os.path.basename(sys.argv[0])) | ||
23 | print("If to-revision is not specified, it defaults to HEAD") | ||
24 | sys.exit(1) | ||
25 | |||
26 | # Set path to OE lib dir so we can import the buildhistory_analysis module | ||
27 | newpath = os.path.abspath(os.path.dirname(os.path.abspath(sys.argv[0])) + '/../meta/lib') | ||
28 | sys.path = sys.path + [newpath] | ||
29 | import oe.buildhistory_analysis | ||
30 | |||
31 | if len(sys.argv) > 3: | ||
32 | torev = sys.argv[3] | ||
33 | else: | ||
34 | torev = 'HEAD' | ||
35 | changes = oe.buildhistory_analysis.process_changes(sys.argv[1], sys.argv[2], torev) | ||
36 | for chg in changes: | ||
37 | print('%s' % chg) | ||
38 | |||
39 | sys.exit(0) | ||
40 | |||
41 | |||
42 | if __name__ == "__main__": | ||
43 | main() | ||