diff options
Diffstat (limited to 'scripts/buildhistory-diff')
| -rwxr-xr-x | scripts/buildhistory-diff | 51 |
1 files changed, 32 insertions, 19 deletions
diff --git a/scripts/buildhistory-diff b/scripts/buildhistory-diff index b82240d763..dd9745e80c 100755 --- a/scripts/buildhistory-diff +++ b/scripts/buildhistory-diff @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # Report significant differences in the buildhistory repository since a specific revision # @@ -14,7 +14,7 @@ from distutils.version import LooseVersion try: import git except ImportError: - print("Please install GitPython (python-git) 0.3.1 or later in order to use this script") + print("Please install GitPython (python3-git) 0.3.4 or later in order to use this script") sys.exit(1) def main(): @@ -27,6 +27,18 @@ def main(): parser.add_option("-p", "--buildhistory-dir", help = "Specify path to buildhistory directory (defaults to buildhistory/ under cwd)", action="store", dest="buildhistory_dir", default='buildhistory/') + parser.add_option("-v", "--report-version", + help = "Report changes in PKGE/PKGV/PKGR even when the values are still the default (PE/PV/PR)", + action="store_true", dest="report_ver", default=False) + parser.add_option("-a", "--report-all", + help = "Report all changes, not just the default significant ones", + action="store_true", dest="report_all", default=False) + parser.add_option("-s", "--signatures", + help = "Report list of signatures differing instead of output", + action="store_true", dest="sigs", default=False) + parser.add_option("-S", "--signatures-with-diff", + help = "Report on actual signature differences instead of output (requires signature data to have been generated, either by running the actual tasks or using bitbake -S)", + action="store_true", dest="sigsdiff", default=False) options, args = parser.parse_args(sys.argv) @@ -40,28 +52,29 @@ def main(): sys.exit(1) if not os.path.exists(options.buildhistory_dir): + if options.buildhistory_dir == 'buildhistory/': + cwd = os.getcwd() + if os.path.basename(cwd) == 'buildhistory': + options.buildhistory_dir = cwd + if not os.path.exists(options.buildhistory_dir): sys.stderr.write('Buildhistory directory "%s" does not exist\n\n' % options.buildhistory_dir) parser.print_help() sys.exit(1) + scripts_path = os.path.abspath(os.path.dirname(os.path.abspath(sys.argv[0]))) + lib_path = scripts_path + '/lib' + sys.path = sys.path + [lib_path] + + import scriptpath + # Set path to OE lib dir so we can import the buildhistory_analysis module - basepath = os.path.abspath(os.path.dirname(os.path.abspath(sys.argv[0])) + '/..') - newpath = basepath + '/meta/lib' + scriptpath.add_oe_lib_path() # Set path to bitbake lib dir so the buildhistory_analysis module can load bb.utils - if os.path.exists(basepath + '/bitbake/lib/bb'): - bitbakepath = basepath + '/bitbake' - else: - # look for bitbake/bin dir in PATH - bitbakepath = None - for pth in os.environ['PATH'].split(':'): - if os.path.exists(os.path.join(pth, '../lib/bb')): - bitbakepath = os.path.abspath(os.path.join(pth, '..')) - break - if not bitbakepath: - sys.stderr.write("Unable to find bitbake by searching parent directory of this script or PATH\n") - sys.exit(1) - - sys.path[0:0] = [newpath, bitbakepath + '/lib'] + bitbakepath = scriptpath.add_bitbake_lib_path() + if not bitbakepath: + sys.stderr.write("Unable to find bitbake by searching parent directory of this script or PATH\n") + sys.exit(1) + import oe.buildhistory_analysis fromrev = 'build-minus-1' @@ -79,7 +92,7 @@ def main(): import gitdb try: - changes = oe.buildhistory_analysis.process_changes(options.buildhistory_dir, fromrev, torev) + changes = oe.buildhistory_analysis.process_changes(options.buildhistory_dir, fromrev, torev, options.report_all, options.report_ver, options.sigs, options.sigsdiff) except gitdb.exc.BadObject as e: if len(args) == 1: sys.stderr.write("Unable to find previous build revision in buildhistory repository\n\n") |
