From 13dd4339960bed036a8c2596c6cf6ee4fd6928bd Mon Sep 17 00:00:00 2001 From: Corentin Chary Date: Mon, 25 Apr 2011 22:24:52 +0200 Subject: [PATCH] euscan: remove some false positives Signed-off-by: Corentin Chary --- euscan | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/euscan b/euscan index c6d66aa..40849e0 100755 --- a/euscan +++ b/euscan @@ -51,7 +51,7 @@ BLACKLIST_PACKAGES = ['sys-kernel/usermode-sources', 'sys-kernel/xbox-sources', SCANDIR_BLACKLIST_URLS = ['mirror://rubygems/(.*)', 'mirror://gentoo/(.*)'] BRUTEFORCE_BLACKLIST_PACKAGES = ['dev-util/patchelf', 'net-zope/plonepopoll'] -BRUTEFORCE_BLACKLIST_URLS = ['http://(.*)dockapps.org/download.php/id/(.*)'] +BRUTEFORCE_BLACKLIST_URLS = ['http://(.*)dockapps.org/download.php/id/(.*)', 'http://hydra.nixos.org/build/(.*)'] _v = r'((\d+)((\.\d+)*)([a-zA-Z]*?)(((-|_)(pre|p|beta|b|alpha|a|rc|r)\d*)*))' @@ -86,6 +86,15 @@ def vercmp(a, b): else: return 1 +def skipnightly(a, b): + a = pkg_resources.parse_version(a) + b = pkg_resources.parse_version(b) + + # Try to skip nightly builds when not wanted (www-apps/moodle) + if len(a) != len(b) and len(b) == 2 and len(b[0]) == len('yyyymmdd'): + return True + return False + def generate_templates_vars(version): ret = [] @@ -316,8 +325,7 @@ def scan_directory_recursive(url, steps, vmin, vmax, output): if vmax and vercmp(version, vmax) >= 0: continue - # Try to skip nightly builds when not wanted (www-apps/moodle) - if len(vmin) != len(version) and len(version) == 2 and len(version[0]) == len('yyyymmdd'): + if skipnightly(vmin, version): continue if not url.endswith('/') and not path.startswith('/'): @@ -609,7 +617,7 @@ def scanUpstream(options, package, output): matches = sorted(matches) pkg = matches.pop() - if pkg.version == '9999': + if '9999' in pkg.version: if len(matches) == 0: sys.stderr.write(pp.warn("Package '%s' only have a dev version (9999)" % pp.pkgquery(package))) sys.exit(errno.ENOENT)