Allow emerge --fetchonly to continue downloading other packages after a download...
authorZac Medico <zmedico@gentoo.org>
Mon, 25 Jun 2007 03:14:42 +0000 (03:14 -0000)
committerZac Medico <zmedico@gentoo.org>
Mon, 25 Jun 2007 03:14:42 +0000 (03:14 -0000)
svn path=/main/branches/2.1.2/; revision=7021

bin/emerge
pym/portage.py

index 67bf8db2a101b8c0f77913b181c3c72f87aeab66..289d992e55b52d049be1fa8c39674a8ee6c5a966 100755 (executable)
@@ -48,6 +48,7 @@ import portage_locks
 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
@@ -2954,6 +2955,8 @@ class MergeTask(object):
 
        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
@@ -3250,9 +3253,29 @@ class MergeTask(object):
                                                        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)
index 9307ce8be4eac315341584ad83041409b4f754fd..2a1c1c6ca69fefbcd362f9156fe0eb4db7b37eb0 100644 (file)
@@ -6827,7 +6827,8 @@ class binarytree(object):
                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."