summaryrefslogtreecommitdiffstats
path: root/scripts/contrib/list-packageconfig-flags.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/contrib/list-packageconfig-flags.py')
-rwxr-xr-xscripts/contrib/list-packageconfig-flags.py29
1 files changed, 11 insertions, 18 deletions
diff --git a/scripts/contrib/list-packageconfig-flags.py b/scripts/contrib/list-packageconfig-flags.py
index 371033a3d8..615f91fdc7 100755
--- a/scripts/contrib/list-packageconfig-flags.py
+++ b/scripts/contrib/list-packageconfig-flags.py
@@ -23,26 +23,19 @@ import sys
23import getopt 23import getopt
24import os 24import os
25 25
26def search_bitbakepath(): 26
27 bitbakepath = "" 27scripts_path = os.path.abspath(os.path.dirname(os.path.abspath(sys.argv[0])))
28 28lib_path = os.path.abspath(scripts_path + '/../lib')
29 # Search path to bitbake lib dir in order to load bb modules 29sys.path = sys.path + [lib_path]
30 if os.path.exists(os.path.join(os.path.dirname(sys.argv[0]), '../../bitbake/lib/bb')): 30
31 bitbakepath = os.path.join(os.path.dirname(sys.argv[0]), '../../bitbake/lib') 31import scriptpath
32 bitbakepath = os.path.abspath(bitbakepath)
33 else:
34 # Look for bitbake/bin dir in PATH
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, '../lib'))
38 break
39 if not bitbakepath:
40 sys.stderr.write("Unable to find bitbake by searching parent directory of this script or PATH\n")
41 sys.exit(1)
42 return bitbakepath
43 32
44# For importing the following modules 33# For importing the following modules
45sys.path.insert(0, search_bitbakepath()) 34bitbakepath = scriptpath.add_bitbake_lib_path()
35if not bitbakepath:
36 sys.stderr.write("Unable to find bitbake by searching parent directory of this script or PATH\n")
37 sys.exit(1)
38
46import bb.cache 39import bb.cache
47import bb.cooker 40import bb.cooker
48import bb.providers 41import bb.providers