summaryrefslogtreecommitdiffstats
path: root/import-layers/yocto-poky/scripts/contrib/verify-homepage.py
diff options
context:
space:
mode:
authorDave Cobbley <david.j.cobbley@linux.intel.com>2018-08-14 10:05:37 -0700
committerBrad Bishop <bradleyb@fuzziesquirrel.com>2018-08-22 21:26:31 -0400
commiteb8dc40360f0cfef56fb6947cc817a547d6d9bc6 (patch)
treede291a73dc37168da6370e2cf16c347d1eba9df8 /import-layers/yocto-poky/scripts/contrib/verify-homepage.py
parent9c3cf826d853102535ead04cebc2d6023eff3032 (diff)
downloadblackbird-openbmc-eb8dc40360f0cfef56fb6947cc817a547d6d9bc6.tar.gz
blackbird-openbmc-eb8dc40360f0cfef56fb6947cc817a547d6d9bc6.zip
[Subtree] Removing import-layers directory
As part of the move to subtrees, need to bring all the import layers content to the top level. Change-Id: I4a163d10898cbc6e11c27f776f60e1a470049d8f Signed-off-by: Dave Cobbley <david.j.cobbley@linux.intel.com> Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Diffstat (limited to 'import-layers/yocto-poky/scripts/contrib/verify-homepage.py')
-rwxr-xr-ximport-layers/yocto-poky/scripts/contrib/verify-homepage.py62
1 files changed, 0 insertions, 62 deletions
diff --git a/import-layers/yocto-poky/scripts/contrib/verify-homepage.py b/import-layers/yocto-poky/scripts/contrib/verify-homepage.py
deleted file mode 100755
index 76f1749cf..000000000
--- a/import-layers/yocto-poky/scripts/contrib/verify-homepage.py
+++ /dev/null
@@ -1,62 +0,0 @@
-#!/usr/bin/env python3
-
-# This script can be used to verify HOMEPAGE values for all recipes in
-# the current configuration.
-# The result is influenced by network environment, since the timeout of connect url is 5 seconds as default.
-
-import sys
-import os
-import subprocess
-import urllib.request
-
-
-# Allow importing scripts/lib modules
-scripts_path = os.path.abspath(os.path.dirname(os.path.realpath(__file__)) + '/..')
-lib_path = scripts_path + '/lib'
-sys.path = sys.path + [lib_path]
-import scriptpath
-import scriptutils
-
-# Allow importing bitbake modules
-bitbakepath = scriptpath.add_bitbake_lib_path()
-
-import bb.tinfoil
-
-logger = scriptutils.logger_create('verify_homepage')
-
-def wgetHomepage(pn, homepage):
- result = subprocess.call('wget ' + '-q -T 5 -t 1 --spider ' + homepage, shell = True)
- if result:
- logger.warn("%s: failed to verify HOMEPAGE: %s " % (pn, homepage))
- return 1
- else:
- return 0
-
-def verifyHomepage(bbhandler):
- pkg_pn = bbhandler.cooker.recipecaches[''].pkg_pn
- pnlist = sorted(pkg_pn)
- count = 0
- checked = []
- for pn in pnlist:
- for fn in pkg_pn[pn]:
- # There's no point checking multiple BBCLASSEXTENDed variants of the same recipe
- realfn, _, _ = bb.cache.virtualfn2realfn(fn)
- if realfn in checked:
- continue
- data = bbhandler.parse_recipe_file(realfn)
- homepage = data.getVar("HOMEPAGE")
- if homepage:
- try:
- urllib.request.urlopen(homepage, timeout=5)
- except Exception:
- count = count + wgetHomepage(os.path.basename(realfn), homepage)
- checked.append(realfn)
- return count
-
-if __name__=='__main__':
- with bb.tinfoil.Tinfoil() as bbhandler:
- bbhandler.prepare()
- logger.info("Start verifying HOMEPAGE:")
- failcount = verifyHomepage(bbhandler)
- logger.info("Finished verifying HOMEPAGE.")
- logger.info("Summary: %s failed" % failcount)
OpenPOWER on IntegriCloud