diff options
Diffstat (limited to 'scripts/buildhistory-diff')
-rwxr-xr-x | scripts/buildhistory-diff | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/scripts/buildhistory-diff b/scripts/buildhistory-diff index ad50414bce..dfebcddf72 100755 --- a/scripts/buildhistory-diff +++ b/scripts/buildhistory-diff | |||
@@ -50,24 +50,20 @@ def main(): | |||
50 | parser.print_help() | 50 | parser.print_help() |
51 | sys.exit(1) | 51 | sys.exit(1) |
52 | 52 | ||
53 | scripts_path = os.path.abspath(os.path.dirname(os.path.abspath(sys.argv[0]))) | ||
54 | lib_path = scripts_path + '/lib' | ||
55 | sys.path = sys.path + [lib_path] | ||
56 | |||
57 | import scriptpath | ||
58 | |||
53 | # Set path to OE lib dir so we can import the buildhistory_analysis module | 59 | # Set path to OE lib dir so we can import the buildhistory_analysis module |
54 | basepath = os.path.abspath(os.path.dirname(os.path.abspath(sys.argv[0])) + '/..') | 60 | scriptpath.add_oe_lib_path() |
55 | newpath = basepath + '/meta/lib' | ||
56 | # Set path to bitbake lib dir so the buildhistory_analysis module can load bb.utils | 61 | # Set path to bitbake lib dir so the buildhistory_analysis module can load bb.utils |
57 | if os.path.exists(basepath + '/bitbake/lib/bb'): | 62 | bitbakepath = scriptpath.add_bitbake_lib_path() |
58 | bitbakepath = basepath + '/bitbake' | 63 | if not bitbakepath: |
59 | else: | 64 | sys.stderr.write("Unable to find bitbake by searching parent directory of this script or PATH\n") |
60 | # look for bitbake/bin dir in PATH | 65 | sys.exit(1) |
61 | bitbakepath = None | 66 | |
62 | for pth in os.environ['PATH'].split(':'): | ||
63 | if os.path.exists(os.path.join(pth, '../lib/bb')): | ||
64 | bitbakepath = os.path.abspath(os.path.join(pth, '..')) | ||
65 | break | ||
66 | if not bitbakepath: | ||
67 | sys.stderr.write("Unable to find bitbake by searching parent directory of this script or PATH\n") | ||
68 | sys.exit(1) | ||
69 | |||
70 | sys.path[0:0] = [newpath, bitbakepath + '/lib'] | ||
71 | import oe.buildhistory_analysis | 67 | import oe.buildhistory_analysis |
72 | 68 | ||
73 | fromrev = 'build-minus-1' | 69 | fromrev = 'build-minus-1' |