From b1c96790b571aed15d126e9e48a4a4b972365892 Mon Sep 17 00:00:00 2001 From: Jason Stubbs Date: Wed, 21 Dec 2005 14:48:56 +0000 Subject: [PATCH] Prevent traceback on fetcher failure and properly check for error conditions when fetching remote binary packages. #116276 svn path=/main/trunk/; revision=2419 --- bin/emerge | 3 ++- pym/getbinpkg.py | 5 ++++- pym/portage.py | 3 +-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/bin/emerge b/bin/emerge index d9f18b238..e4f510976 100755 --- a/bin/emerge +++ b/bin/emerge @@ -2037,7 +2037,8 @@ class depgraph: if portage.db[portage.root]["bintree"].isremote(x[2]): short_msg = "emerge: ("+str(mergecount)+" of "+str(len(mymergelist))+") "+x[pkgindex]+" Fetch" emergelog(" --- ("+str(mergecount)+" of "+str(len(mymergelist))+") Fetching Binary ("+x[pkgindex]+"::"+mytbz2+")", short_msg=short_msg) - portage.db[portage.root]["bintree"].gettbz2(x[2]) + if not portage.db[portage.root]["bintree"].gettbz2(x[2]): + sys.exit(1) if ("--fetchonly" in myopts) or ("--fetch-all-uri" in myopts): continue diff --git a/pym/getbinpkg.py b/pym/getbinpkg.py index b74fa04d9..ccffc1dd2 100644 --- a/pym/getbinpkg.py +++ b/pym/getbinpkg.py @@ -362,7 +362,10 @@ def file_get(baseurl,dest,conn=None,fcmd=None): myargs = [os.path.basename(mycmd)]+mysplit[1:] mypid=os.fork() if mypid == 0: - os.execv(mycmd,myargs) + try: + os.execv(mycmd,myargs) + except OSError: + pass sys.stderr.write("!!! Failed to spawn fetcher.\n") sys.exit(1) retval=os.waitpid(mypid,0)[1] diff --git a/pym/portage.py b/pym/portage.py index 3d2058f15..09a8504bd 100644 --- a/pym/portage.py +++ b/pym/portage.py @@ -5442,8 +5442,7 @@ class binarytree(packagetree): raise except: pass - getbinpkg.file_get(settings["PORTAGE_BINHOST"]+"/"+tbz2name, mydest, fcmd=settings["RESUMECOMMAND"]) - return + return getbinpkg.file_get(settings["PORTAGE_BINHOST"]+"/"+tbz2name, mydest, fcmd=settings["RESUMECOMMAND"]) def getslot(self,mycatpkg): "Get a slot for a catpkg; assume it exists." -- 2.26.2