diff options
Diffstat (limited to 'scripts')
-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() | ||