diff options
-rwxr-xr-x | scripts/contrib/verify-homepage.py | 28 |
1 files changed, 9 insertions, 19 deletions
diff --git a/scripts/contrib/verify-homepage.py b/scripts/contrib/verify-homepage.py index 86cc82bca3..9953babf6d 100755 --- a/scripts/contrib/verify-homepage.py +++ b/scripts/contrib/verify-homepage.py | |||
@@ -8,26 +8,16 @@ import os | |||
8 | import subprocess | 8 | import subprocess |
9 | import urllib2 | 9 | import urllib2 |
10 | 10 | ||
11 | def search_bitbakepath(): | ||
12 | bitbakepath = "" | ||
13 | 11 | ||
14 | # Search path to bitbake lib dir in order to load bb modules | 12 | # Allow importing scripts/lib modules |
15 | if os.path.exists(os.path.join(os.path.dirname(sys.argv[0]), '../../bitbake/lib/bb')): | 13 | scripts_path = os.path.abspath(os.path.dirname(os.path.realpath(__file__)) + '/..') |
16 | bitbakepath = os.path.join(os.path.dirname(sys.argv[0]), '../../bitbake/lib') | 14 | lib_path = scripts_path + '/lib' |
17 | bitbakepath = os.path.abspath(bitbakepath) | 15 | sys.path = sys.path + [lib_path] |
18 | else: | 16 | import scriptpath |
19 | # Look for bitbake/bin dir in PATH | 17 | |
20 | for pth in os.environ['PATH'].split(':'): | 18 | # Allow importing bitbake modules |
21 | if os.path.exists(os.path.join(pth, '../lib/bb')): | 19 | bitbakepath = scriptpath.add_bitbake_lib_path() |
22 | bitbakepath = os.path.abspath(os.path.join(pth, '../lib')) | 20 | |
23 | break | ||
24 | if not bitbakepath: | ||
25 | sys.stderr.write("Unable to find bitbake by searching parent directory of this script or PATH\n") | ||
26 | sys.exit(1) | ||
27 | return bitbakepath | ||
28 | |||
29 | # For importing the following modules | ||
30 | sys.path.insert(0, search_bitbakepath()) | ||
31 | import bb.tinfoil | 21 | import bb.tinfoil |
32 | 22 | ||
33 | def wgetHomepage(pn, homepage): | 23 | def wgetHomepage(pn, homepage): |