Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH 0/1] scripts/contrib/verify-homepage.py: add a script to verify HOMEPAGE
@ 2014-06-25  9:39 Chong Lu
  2014-06-25  9:39 ` [PATCH 1/1] " Chong Lu
  2014-07-01  1:39 ` [PATCH 0/1] " Chong Lu
  0 siblings, 2 replies; 3+ messages in thread
From: Chong Lu @ 2014-06-25  9:39 UTC (permalink / raw)
  To: openembedded-core

The following changes since commit 3c7b5ec1cae6186a64e0be2c05b64b05add08c97:

  syslinux: fix isohybird overflows on 32 bit system (2014-06-24 19:54:12 +0100)

are available in the git repository at:

  git://git.pokylinux.org/poky-contrib chonglu/verifyhomepage
  http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=chonglu/verifyhomepage

Chong Lu (1):
  scripts/contrib/verify-homepage.py: add a script to verify HOMEPAGE

 scripts/contrib/verify-homepage.py | 63 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 63 insertions(+)
 create mode 100755 scripts/contrib/verify-homepage.py

-- 
1.9.1



^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/1] scripts/contrib/verify-homepage.py: add a script to verify HOMEPAGE
  2014-06-25  9:39 [PATCH 0/1] scripts/contrib/verify-homepage.py: add a script to verify HOMEPAGE Chong Lu
@ 2014-06-25  9:39 ` Chong Lu
  2014-07-01  1:39 ` [PATCH 0/1] " Chong Lu
  1 sibling, 0 replies; 3+ messages in thread
From: Chong Lu @ 2014-06-25  9:39 UTC (permalink / raw)
  To: openembedded-core

Add a script to verify all the recipes' HOMEPAGE.

[YOCTO #5689]

Signed-off-by: Chong Lu <Chong.Lu@windriver.com>
---
 scripts/contrib/verify-homepage.py | 63 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 63 insertions(+)
 create mode 100755 scripts/contrib/verify-homepage.py

diff --git a/scripts/contrib/verify-homepage.py b/scripts/contrib/verify-homepage.py
new file mode 100755
index 0000000..86cc82b
--- /dev/null
+++ b/scripts/contrib/verify-homepage.py
@@ -0,0 +1,63 @@
+#!/usr/bin/env python
+
+# This script is used for verify HOMEPAGE.
+# 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 urllib2
+
+def search_bitbakepath():
+    bitbakepath = ""
+
+    # Search path to bitbake lib dir in order to load bb modules
+    if os.path.exists(os.path.join(os.path.dirname(sys.argv[0]), '../../bitbake/lib/bb')):
+        bitbakepath = os.path.join(os.path.dirname(sys.argv[0]), '../../bitbake/lib')
+        bitbakepath = os.path.abspath(bitbakepath)
+    else:
+        # Look for bitbake/bin dir in PATH
+        for pth in os.environ['PATH'].split(':'):
+            if os.path.exists(os.path.join(pth, '../lib/bb')):
+                bitbakepath = os.path.abspath(os.path.join(pth, '../lib'))
+                break
+        if not bitbakepath:
+            sys.stderr.write("Unable to find bitbake by searching parent directory of this script or PATH\n")
+            sys.exit(1)
+    return bitbakepath
+
+# For importing the following modules
+sys.path.insert(0, search_bitbakepath())
+import bb.tinfoil
+
+def wgetHomepage(pn, homepage):
+    result = subprocess.call('wget ' + '-q -T 5 -t 1 --spider ' + homepage, shell = True)
+    if result:
+        bb.warn("Failed to verify HOMEPAGE (%s) of %s" % (homepage, pn))
+        return 1
+    else:
+        return 0
+
+def verifyHomepage(bbhandler):
+    pkg_pn = bbhandler.cooker.recipecache.pkg_pn
+    pnlist = sorted(pkg_pn)
+    count = 0
+    for pn in pnlist:
+        fn = pkg_pn[pn].pop()
+        data = bb.cache.Cache.loadDataFull(fn, bbhandler.cooker.collection.get_file_appends(fn), bbhandler.config_data)
+        homepage = data.getVar("HOMEPAGE")
+        if homepage:
+            try:
+                urllib2.urlopen(homepage, timeout=5)
+            except Exception:
+                count = count + wgetHomepage(pn, homepage)
+    return count
+
+if __name__=='__main__':
+    failcount = 0
+    bbhandler = bb.tinfoil.Tinfoil()
+    bbhandler.prepare()
+    print "Start to verify HOMEPAGE:"
+    failcount = verifyHomepage(bbhandler)
+    print "finish to verify HOMEPAGE."
+    print "Summary: %s failed" % failcount
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 0/1] scripts/contrib/verify-homepage.py: add a script to verify HOMEPAGE
  2014-06-25  9:39 [PATCH 0/1] scripts/contrib/verify-homepage.py: add a script to verify HOMEPAGE Chong Lu
  2014-06-25  9:39 ` [PATCH 1/1] " Chong Lu
@ 2014-07-01  1:39 ` Chong Lu
  1 sibling, 0 replies; 3+ messages in thread
From: Chong Lu @ 2014-07-01  1:39 UTC (permalink / raw)
  To: Chong Lu, openembedded-core

ping

On 06/25/2014 05:39 PM, Chong Lu wrote:
> The following changes since commit 3c7b5ec1cae6186a64e0be2c05b64b05add08c97:
>
>    syslinux: fix isohybird overflows on 32 bit system (2014-06-24 19:54:12 +0100)
>
> are available in the git repository at:
>
>    git://git.pokylinux.org/poky-contrib chonglu/verifyhomepage
>    http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=chonglu/verifyhomepage
>
> Chong Lu (1):
>    scripts/contrib/verify-homepage.py: add a script to verify HOMEPAGE
>
>   scripts/contrib/verify-homepage.py | 63 ++++++++++++++++++++++++++++++++++++++
>   1 file changed, 63 insertions(+)
>   create mode 100755 scripts/contrib/verify-homepage.py
>



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-07-01  1:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-25  9:39 [PATCH 0/1] scripts/contrib/verify-homepage.py: add a script to verify HOMEPAGE Chong Lu
2014-06-25  9:39 ` [PATCH 1/1] " Chong Lu
2014-07-01  1:39 ` [PATCH 0/1] " Chong Lu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox