]> code.ossystems Code Review - openembedded-core.git/commitdiff
buildhistory-diff: operate from buildhistory directory
authorPaul Eggleton <paul.eggleton@linux.intel.com>
Fri, 7 Apr 2017 04:57:18 +0000 (16:57 +1200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 11 Apr 2017 17:09:19 +0000 (18:09 +0100)
If the cwd is named "buildhistory" and the user hasn't specified an
alternative path on the command line, then assume that the current
directory is the buildhistory directory. This makes it easier to run
buildhistory-diff and also interact with the buildhistory git repository
as you no longer have to jump into the buildhistory directory and up to
the parent again when doing so.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/buildhistory-diff

index d8ca12d3e66c3f340218dd12b1db6f20eb5b570f..e03ccc5ed84f5bcfa18d61a1998d48b5de159434 100755 (executable)
@@ -45,6 +45,11 @@ def main():
         sys.stderr.write("Version of GitPython is too old, please install GitPython (python-git) 0.3.1 or later in order to use this script\n")
         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()