diff options
author | Zac Medico <zmedico@gentoo.org> | 2007-06-25 03:14:42 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2007-06-25 03:14:42 +0000 |
commit | d516fad5be413aa965b241f136d0e8f701fc83fd (patch) | |
tree | 5441d0200a9a263097d0ee3d20f64855923ed7a3 /bin | |
parent | 3364386de1065777a6310b575f88dd50c99c9f8c (diff) | |
download | portage-d516fad5be413aa965b241f136d0e8f701fc83fd.tar.gz portage-d516fad5be413aa965b241f136d0e8f701fc83fd.tar.bz2 portage-d516fad5be413aa965b241f136d0e8f701fc83fd.zip |
Allow emerge --fetchonly to continue downloading other packages after a download from a binhost fails. (trunk r6709)
svn path=/main/branches/2.1.2/; revision=7021
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/emerge | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/bin/emerge b/bin/emerge index 67bf8db2a..289d992e5 100755 --- a/bin/emerge +++ b/bin/emerge @@ -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) |