summaryrefslogtreecommitdiffstats
path: root/scripts/buildhistory-diff
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/buildhistory-diff')
-rwxr-xr-xscripts/buildhistory-diff21
1 files changed, 18 insertions, 3 deletions
diff --git a/scripts/buildhistory-diff b/scripts/buildhistory-diff
index 6b344ebfaf..9936a4b605 100755
--- a/scripts/buildhistory-diff
+++ b/scripts/buildhistory-diff
@@ -6,7 +6,7 @@
6# Author: Paul Eggleton <paul.eggleton@linux.intel.com> 6# Author: Paul Eggleton <paul.eggleton@linux.intel.com>
7 7
8import sys 8import sys
9import os.path 9import os
10 10
11# Ensure PythonGit is installed (buildhistory_analysis needs it) 11# Ensure PythonGit is installed (buildhistory_analysis needs it)
12try: 12try:
@@ -24,8 +24,23 @@ def main():
24 sys.exit(1) 24 sys.exit(1)
25 25
26 # Set path to OE lib dir so we can import the buildhistory_analysis module 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') 27 basepath = os.path.abspath(os.path.dirname(os.path.abspath(sys.argv[0])) + '/..')
28 sys.path = sys.path + [newpath] 28 newpath = basepath + '/meta/lib'
29 # Set path to bitbake lib dir so the buildhistory_analysis module can load bb.utils
30 if os.path.exists(basepath + '/bitbake/lib/bb'):
31 bitbakepath = basepath + '/bitbake'
32 else:
33 # look for bitbake/bin dir in PATH
34 bitbakepath = None
35 for pth in os.environ['PATH'].split(':'):
36 if os.path.exists(os.path.join(pth, '../lib/bb')):
37 bitbakepath = os.path.abspath(os.path.join(pth, '..'))
38 break
39 if not bitbakepath:
40 print("Unable to find bitbake by searching parent directory of this script or PATH")
41 sys.exit(1)
42
43 sys.path.extend([newpath, bitbakepath + '/lib'])
29 import oe.buildhistory_analysis 44 import oe.buildhistory_analysis
30 45
31 if len(sys.argv) > 3: 46 if len(sys.argv) > 3: