summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pym/portage/getbinpkg.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/pym/portage/getbinpkg.py b/pym/portage/getbinpkg.py
index 87f205528..d2d1f75ab 100644
--- a/pym/portage/getbinpkg.py
+++ b/pym/portage/getbinpkg.py
@@ -307,7 +307,9 @@ def dir_get_list(baseurl,conn=None):
del page
listing = parser.get_anchors()
else:
- raise Exception, "Unable to get listing: %s %s" % (rc,msg)
+ import portage.exception
+ raise portage.exception.PortageException(
+ "Unable to get listing: %s %s" % (rc,msg))
elif protocol in ["ftp"]:
if address[-1] == '/':
olddir = conn.pwd()
@@ -486,7 +488,14 @@ def dir_get_metadata(baseurl, conn=None, chunk_size=3000, verbose=1, usingcache=
sys.stderr.write("!!! Permission denied: '%s'\n" % cache_path)
return metadata[baseurl]["data"]
- filelist = dir_get_list(baseurl, conn)
+ import portage.exception
+ try:
+ filelist = dir_get_list(baseurl, conn)
+ except portage.exception.PortageException, e:
+ sys.stderr.write("!!! Error connecting to '%s'.\n" % baseurl)
+ sys.stderr.write("!!! %s\n" % str(e))
+ del e
+ return metadata[baseurl]["data"]
tbz2list = match_in_array(filelist, suffix=".tbz2")
metalist = match_in_array(filelist, prefix="metadata.idx")
del filelist