diff options
author | 2020-09-15 13:55:48 +0100 | |
---|---|---|
committer | 2020-09-17 09:47:46 +0100 | |
commit | 4064756e20bb4eff59d53f495b89d16ff479bb4d (patch) | |
tree | 6c6dabc0c50d22f6912fcd61d82fa2cea8e80474 /scripts | |
parent | d393196485d490af8397d074e2060540ff41c504 (diff) | |
download | poky-4064756e20bb4eff59d53f495b89d16ff479bb4d.tar.gz poky-4064756e20bb4eff59d53f495b89d16ff479bb4d.tar.bz2 poky-4064756e20bb4eff59d53f495b89d16ff479bb4d.zip |
buildhistory-diff: use BUILDDIR to know where buildhistory is
Instead of assuming that the buildhistory is stored in ./buildhistory
unless told otherwise, use the environment variable BUILDDIR if present
(which is set by oe-init-build-env) to locate the buildhistory
directory.
(From OE-Core rev: 18ca377df98e53b84ae8ec9ba561392c776c10df)
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/buildhistory-diff | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/scripts/buildhistory-diff b/scripts/buildhistory-diff index 833f7c33a5..3bd40a2a1e 100755 --- a/scripts/buildhistory-diff +++ b/scripts/buildhistory-diff @@ -28,10 +28,12 @@ def get_args_parser(): %(prog)s [options] [from-revision [to-revision]] (if not specified, from-revision defaults to build-minus-1, and to-revision defaults to HEAD)""") + default_dir = os.path.join(os.environ.get('BUILDDIR', '.'), 'buildhistory') + parser.add_argument('-p', '--buildhistory-dir', action='store', dest='buildhistory_dir', - default='buildhistory/', + default=default_dir, help="Specify path to buildhistory directory (defaults to buildhistory/ under cwd)") parser.add_argument('-v', '--report-version', action='store_true', @@ -80,11 +82,6 @@ def main(): parser.print_help() sys.exit(1) - if not os.path.exists(args.buildhistory_dir): - if args.buildhistory_dir == 'buildhistory/': - cwd = os.getcwd() - if os.path.basename(cwd) == 'buildhistory': - args.buildhistory_dir = cwd if not os.path.exists(args.buildhistory_dir): sys.stderr.write('Buildhistory directory "%s" does not exist\n\n' % args.buildhistory_dir) |