import portage_exception
from portage_data import secpass
from portage_util import normalize_path as normpath
+from portage_util import writemsg
if not hasattr(__builtins__, "set"):
from sets import Set as set
def merge(self, mylist, favorites, mtimedb):
failed_fetches = []
+ fetchonly = "--fetchonly" in self.myopts or \
+ "--fetch-all-uri" in self.myopts
mymergelist=[]
ldpath_mtimes = mtimedb["ldpath"]
xterm_titles = "notitles" not in self.settings.features
short_msg = "emerge: (%s of %s) %s Fetch" % \
(mergecount, len(mymergelist), pkg_key)
emergelog(xterm_titles, msg, short_msg=short_msg)
- if not self.trees[myroot]["bintree"].gettbz2(
- pkg_key):
- return 1
+ try:
+ self.trees[myroot]["bintree"].gettbz2(pkg_key)
+ except portage_exception.FileNotFound:
+ writemsg("!!! Fetching Binary failed " + \
+ "for '%s'\n" % pkg_key, noiselevel=-1)
+ if not fetchonly:
+ return 1
+ failed_fetches.append(pkg_key)
+ except portage_exception.DigestException, e:
+ writemsg("\n!!! Digest verification failed:\n",
+ noiselevel=-1)
+ writemsg("!!! %s\n" % e.value[0],
+ noiselevel=-1)
+ writemsg("!!! Reason: %s\n" % e.value[1],
+ noiselevel=-1)
+ writemsg("!!! Got: %s\n" % e.value[2],
+ noiselevel=-1)
+ writemsg("!!! Expected: %s\n" % e.value[3],
+ noiselevel=-1)
+ os.unlink(mytbz2)
+ if not fetchonly:
+ return 1
+ failed_fetches.append(pkg_key)
finally:
if tbz2_lock:
portage_locks.unlockfile(tbz2_lock)
fcmd = self.settings.get(fcmd_prefix + "_" + protocol.upper())
if not fcmd:
fcmd = self.settings.get(fcmd_prefix)
- return getbinpkg.file_get(url, mydest, fcmd=fcmd)
+ if not getbinpkg.file_get(url, mydest, fcmd=fcmd):
+ raise portage_exception.FileNotFound(tbz2_path)
def getslot(self,mycatpkg):
"Get a slot for a catpkg; assume it exists."