summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2015-07-23 11:15:56 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-11-16 11:39:36 +0000
commit0c489216de4705af17da6fb4274b63148e15ef93 (patch)
treedd00114913fcd760fbf19b6afb5382fa5b6f0a9a
parent0e348e76f3caaed3b2a1a2e664e8388c1fd0428c (diff)
downloadpoky-0c489216de4705af17da6fb4274b63148e15ef93.tar.gz
verify-homepage: tidy up output and comments
* Set up and use a proper logger * Tweak output messages and comments (From OE-Core rev: 6ee412409ff9331847fbe4e44d1c2a47d2453f18) 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>
-rwxr-xr-xscripts/contrib/verify-homepage.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/scripts/contrib/verify-homepage.py b/scripts/contrib/verify-homepage.py
index 3e7333959c..522824ba58 100755
--- a/scripts/contrib/verify-homepage.py
+++ b/scripts/contrib/verify-homepage.py
@@ -1,6 +1,7 @@
1#!/usr/bin/env python 1#!/usr/bin/env python
2 2
3# This script is used for verify HOMEPAGE. 3# This script can be used to verify HOMEPAGE values for all recipes in
4# the current configuration.
4# The result is influenced by network environment, since the timeout of connect url is 5 seconds as default. 5# The result is influenced by network environment, since the timeout of connect url is 5 seconds as default.
5 6
6import sys 7import sys
@@ -14,16 +15,19 @@ scripts_path = os.path.abspath(os.path.dirname(os.path.realpath(__file__)) + '/.
14lib_path = scripts_path + '/lib' 15lib_path = scripts_path + '/lib'
15sys.path = sys.path + [lib_path] 16sys.path = sys.path + [lib_path]
16import scriptpath 17import scriptpath
18import scriptutils
17 19
18# Allow importing bitbake modules 20# Allow importing bitbake modules
19bitbakepath = scriptpath.add_bitbake_lib_path() 21bitbakepath = scriptpath.add_bitbake_lib_path()
20 22
21import bb.tinfoil 23import bb.tinfoil
22 24
25logger = scriptutils.logger_create('verify_homepage')
26
23def wgetHomepage(pn, homepage): 27def wgetHomepage(pn, homepage):
24 result = subprocess.call('wget ' + '-q -T 5 -t 1 --spider ' + homepage, shell = True) 28 result = subprocess.call('wget ' + '-q -T 5 -t 1 --spider ' + homepage, shell = True)
25 if result: 29 if result:
26 bb.warn("Failed to verify HOMEPAGE (%s) of %s" % (homepage, pn)) 30 logger.warn("%s: failed to verify HOMEPAGE: %s " % (pn, homepage))
27 return 1 31 return 1
28 else: 32 else:
29 return 0 33 return 0
@@ -44,10 +48,9 @@ def verifyHomepage(bbhandler):
44 return count 48 return count
45 49
46if __name__=='__main__': 50if __name__=='__main__':
47 failcount = 0
48 bbhandler = bb.tinfoil.Tinfoil() 51 bbhandler = bb.tinfoil.Tinfoil()
49 bbhandler.prepare() 52 bbhandler.prepare()
50 print "Start to verify HOMEPAGE:" 53 logger.info("Start verifying HOMEPAGE:")
51 failcount = verifyHomepage(bbhandler) 54 failcount = verifyHomepage(bbhandler)
52 print "finish to verify HOMEPAGE." 55 logger.info("Finished verifying HOMEPAGE.")
53 print "Summary: %s failed" % failcount 56 logger.info("Summary: %s failed" % failcount)