summaryrefslogtreecommitdiffstats
path: root/scripts/contrib
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2015-07-23 11:12:52 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-11-16 11:39:36 +0000
commitcaaca00acbba05e3fbf30482930106485cf8d7fa (patch)
treecbd17c247b894c166fc029b1611e4a852b5def5b /scripts/contrib
parent649b6bcfe8e2777a9c699a15203fe0c74f168ae2 (diff)
downloadpoky-caaca00acbba05e3fbf30482930106485cf8d7fa.tar.gz
verify-homepage: use scriptpath to find bitbake path
We have shared code for this, let's use it. (From OE-Core rev: e7a5d6e7802b58cf6eae1d83e4bf5c50ab66f80a) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/contrib')
-rwxr-xr-xscripts/contrib/verify-homepage.py28
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
8import subprocess 8import subprocess
9import urllib2 9import urllib2
10 10
11def 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')): 13scripts_path = os.path.abspath(os.path.dirname(os.path.realpath(__file__)) + '/..')
16 bitbakepath = os.path.join(os.path.dirname(sys.argv[0]), '../../bitbake/lib') 14lib_path = scripts_path + '/lib'
17 bitbakepath = os.path.abspath(bitbakepath) 15sys.path = sys.path + [lib_path]
18 else: 16import 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')): 19bitbakepath = 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
30sys.path.insert(0, search_bitbakepath())
31import bb.tinfoil 21import bb.tinfoil
32 22
33def wgetHomepage(pn, homepage): 23def wgetHomepage(pn, homepage):