euscan: tweak error paths

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
This commit is contained in:
Corentin Chary 2012-01-02 21:31:05 +01:00
parent 2bd012ef82
commit 72e43ac4fe
3 changed files with 7 additions and 3 deletions

View File

@ -220,9 +220,9 @@ def main():
file=sys.stderr, end="") file=sys.stderr, end="")
pp.die(1, "one of the above fully-qualified ebuild names instead.") pp.die(1, "one of the above fully-qualified ebuild names instead.")
except GentoolkitException as err: except GentoolkitException as err:
pp.die(1, str(err)) pp.die(1, '%s: %s' % (package, str(err)))
except Exception as err: except Exception as err:
pp.die(1, str(err)) pp.die(1, '%s: %s' % (package, str(err)))
if not CONFIG['quiet']: if not CONFIG['quiet']:
print () print ()

View File

@ -97,6 +97,8 @@ def scan(cpv, url):
return [] return []
resolved_url = helpers.parse_mirror(url) resolved_url = helpers.parse_mirror(url)
if not resolved_url:
return []
cp, ver, rev = portage.pkgsplit(cpv) cp, ver, rev = portage.pkgsplit(cpv)
@ -115,6 +117,8 @@ def brute_force(cpv, url):
cp, ver, rev = portage.pkgsplit(cpv) cp, ver, rev = portage.pkgsplit(cpv)
url = helpers.parse_mirror(url) url = helpers.parse_mirror(url)
if not url:
return []
for bp in BRUTEFORCE_BLACKLIST_PACKAGES: for bp in BRUTEFORCE_BLACKLIST_PACKAGES:
if re.match(bp, cp): if re.match(bp, cp):

View File

@ -407,7 +407,7 @@ def parse_mirror(uri):
shuffle(mirrors) shuffle(mirrors)
uri = mirrors[0].strip("/") + "/" + path uri = mirrors[0].strip("/") + "/" + path
else: else:
euscan.output.einfo("No known mirror by the name: %s\n" % (mirrorname)) euscan.output.einfo("No known mirror by the name: %s" % (mirrorname))
return None return None
return uri return uri