Prevent traceback on fetcher failure and properly check for error conditions
authorJason Stubbs <jstubbs@gentoo.org>
Wed, 21 Dec 2005 14:48:56 +0000 (14:48 -0000)
committerJason Stubbs <jstubbs@gentoo.org>
Wed, 21 Dec 2005 14:48:56 +0000 (14:48 -0000)
when fetching remote binary packages.  #116276

svn path=/main/trunk/; revision=2419

bin/emerge
pym/getbinpkg.py
pym/portage.py

index d9f18b238d38bea2bc34c7a51998ffc44e270ba2..e4f5109761dce7eab3c1e85aa307a2029f2bf096 100755 (executable)
@@ -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
index b74fa04d9a4b2c6944d2b0f274b2be1063553372..ccffc1dd2a7a97104d8a95e1bd48770774fdf8f6 100644 (file)
@@ -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]
index 3d2058f15da521ebdef9d37da32c3772ec447f84..09a8504bd8f96dc7196138db1fb03e853e78c32a 100644 (file)
@@ -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."