diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2015-07-23 11:15:56 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-11-16 11:39:36 +0000 |
commit | 0c489216de4705af17da6fb4274b63148e15ef93 (patch) | |
tree | dd00114913fcd760fbf19b6afb5382fa5b6f0a9a | |
parent | 0e348e76f3caaed3b2a1a2e664e8388c1fd0428c (diff) | |
download | poky-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-x | scripts/contrib/verify-homepage.py | 15 |
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 | ||
6 | import sys | 7 | import sys |
@@ -14,16 +15,19 @@ scripts_path = os.path.abspath(os.path.dirname(os.path.realpath(__file__)) + '/. | |||
14 | lib_path = scripts_path + '/lib' | 15 | lib_path = scripts_path + '/lib' |
15 | sys.path = sys.path + [lib_path] | 16 | sys.path = sys.path + [lib_path] |
16 | import scriptpath | 17 | import scriptpath |
18 | import scriptutils | ||
17 | 19 | ||
18 | # Allow importing bitbake modules | 20 | # Allow importing bitbake modules |
19 | bitbakepath = scriptpath.add_bitbake_lib_path() | 21 | bitbakepath = scriptpath.add_bitbake_lib_path() |
20 | 22 | ||
21 | import bb.tinfoil | 23 | import bb.tinfoil |
22 | 24 | ||
25 | logger = scriptutils.logger_create('verify_homepage') | ||
26 | |||
23 | def wgetHomepage(pn, homepage): | 27 | def 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 | ||
46 | if __name__=='__main__': | 50 | if __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) |