Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 16875 Details for
Bug 27669
Patches to allow multiple DISTDIRs
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
A complete patch for 2.0.49-r2
portage.py-2.0.49-r2-02.diff (text/plain), 7.20 KB, created by
Kurt Hindenburg
on 2003-08-31 16:29:50 UTC
(
hide
)
Description:
A complete patch for 2.0.49-r2
Filename:
MIME Type:
Creator:
Kurt Hindenburg
Created:
2003-08-31 16:29:50 UTC
Size:
7.20 KB
patch
obsolete
>--- portage.py 2003-08-31 18:29:17.000000000 -0500 >+++ portage.py-2.0.49-r2 2003-08-31 18:29:40.000000000 -0500 >@@ -1,9 +1,9 @@ > # portage.py -- core Portage functionality > # Copyright 1998-2003 Daniel Robbins, Gentoo Technologies, Inc. > # Distributed under the GNU Public License v2 >-# $Header: /mnt/alpha/cvsroot/kvh/portage-df/portage.py,v 1.30 2003/08/31 23:29:17 kvh Exp $ >+# $Header: /home/cvsroot/gentoo-src/portage/pym/portage.py,v 1.337 2003/08/22 17:09:37 carpaski Exp $ > >-VERSION="2.0.49-r2-k1" >+VERSION="2.0.49-r2" > > from stat import * > from commands import * >@@ -1092,38 +1092,6 @@ > else: > return 16 # interrupted by signal > >- >-#KVH >-def returnFileSizeInDir(mydir,myfile): >- "If myfile found in mydir, return size of myfile; otherwise 0" >- >- st_size=0 >- try: >- mystat=os.stat(mydir+"/"+myfile) >- st_size=mystat[ST_SIZE] >- except (OSError,IOError),e: >- st_size=0 >- return st_size >- >-#KVH >-def findFileInDistDirs(myfile): >- "Check all directories in DISTDIRS for myfile" >- >- mydir="" >- >- if settings["DISTDIRS"]=="": >- return mydir >- >-# Traverse through all directories >- for d in settings["DISTDIRS"].split(":"): >-# print "^^^ Checking for "+myfile+" in "+d >- st_size=returnFileSizeInDir(d,myfile) >- if st_size: >- mydir=d >- break >- >- return mydir >- > def fetch(myuris, listonly=0, fetchonly=0): > "fetch files. Will use digest file if available." > if ("mirror" in features) and ("nomirror" in settings["RESTRICT"].split()): >@@ -1142,31 +1110,6 @@ > resumecommand=string.replace(resumecommand,"${DISTDIR}",settings["DISTDIR"]) > mydigests=None > digestfn=settings["FILESDIR"]+"/digest-"+settings["PF"] >- >-#KVH >- settings["SRC_LINKS"]=settings["PORTAGE_TMPDIR"]+"/source-links" >- >- try: >- if not os.path.exists(settings["SRC_LINKS"]): >- os.makedirs(settings["SRC_LINKS"]) >- os.chown(settings["SRC_LINKS"],portage_uid,portage_gid) >- else: >- #O.K. we'll clean out old links here... >- src_links = settings["SRC_LINKS"] >- files = os.listdir(src_links) >- for file in files: >- jfile = src_links+"/"+file >- if os.path.islink(jfile): >- os.remove(jfile) >- else: >- pass >- >- except Exception, e: >- print "!!! Filesystem error. (Read-Only?)" >- print "!!!",e >- return 0 >- >- > if os.path.exists(digestfn): > myfile=open(digestfn,"r") > mylines=myfile.readlines() >@@ -1237,52 +1180,34 @@ > if listonly: > sys.stderr.write(loc+" ") > continue >- >- fetched=0 >- indistdirs=0 >- # Try the normal place first >- filedir=settings["DISTDIR"] >- mystsize=returnFileSizeInDir(filedir,myfile) >- >- # If not DISTDIR, try all DISTDIRS >- if mystsize==0 and settings["DISTDIRS"]: >- filedir=findFileInDistDirs(myfile) >- if filedir!="": >- mystsize=returnFileSizeInDir(filedir,myfile) >- indistdirs=1 >- >- if mydigests!=None and mydigests.has_key(myfile): >- #if we have the digest file, we know the final size and can resume the download. >- if mystsize == 0: >- fetched=0 >- elif mystsize<mydigests[myfile]["size"]: >- fetched=1 >- # Do not allow resume for files in DISTDIRS >- if indistdirs==1: >- fetched=0 >- else: >- #we already have it downloaded, skip. >- #if our file is bigger than the recorded size, digestcheck should catch it. >- if not fetchonly: >- fetched=2 >+ try: >+ mystat=os.stat(settings["DISTDIR"]+"/"+myfile) >+ if mydigests!=None and mydigests.has_key(myfile): >+ #if we have the digest file, we know the final size and can resume the download. >+ if mystat[ST_SIZE]<mydigests[myfile]["size"]: >+ fetched=1 > else: >- # Check md5sum's at each fetch for fetchonly. >- mymd5=perform_md5(filedir+"/"+myfile) >- if mymd5 != mydigests[myfile]["md5"]: >- sys.stderr.write("!!! Previously fetched file: "+str(myfile)+" MD5 FAILED! Refetching...\n") >-# os.unlink(settings["DISTDIR"]+"/"+myfile) >- fetched=0 >- else: >- sys.stderr.write(">>> Previously fetched file: "+str(myfile)+" MD5 ;-)\n") >+ #we already have it downloaded, skip. >+ #if our file is bigger than the recorded size, digestcheck should catch it. >+ if not fetchonly: > fetched=2 >- break #No need to keep looking for this file, we have it! >- else: >- #we don't have the digest file, but the file exists. Assume it is fully downloaded. >- fetched=2 >+ else: >+ # Check md5sum's at each fetch for fetchonly. >+ mymd5=perform_md5(settings["DISTDIR"]+"/"+myfile) >+ if mymd5 != mydigests[myfile]["md5"]: >+ sys.stderr.write("!!! Previously fetched file: "+str(myfile)+" MD5 FAILED! Refetching...\n") >+ os.unlink(settings["DISTDIR"]+"/"+myfile) >+ fetched=0 >+ else: >+ sys.stderr.write(">>> Previously fetched file: "+str(myfile)+" MD5 ;-)\n") >+ fetched=2 >+ break #No need to keep looking for this file, we have it! >+ else: >+ #we don't have the digest file, but the file exists. Assume it is fully downloaded. >+ fetched=2 >+ except (OSError,IOError),e: >+ fetched=0 > if fetched!=2: >- # Reset filedir to point to original DISTDIR >- filedir=settings["DISTDIR"] >- > #we either need to resume or start the download > #you can't use "continue" when you're inside a "try" block > if fetched==1: >@@ -1344,22 +1269,6 @@ > if (fetched!=2) and not listonly: > sys.stderr.write("!!! Couldn't download "+str(myfile)+". Aborting.\n") > return 0 >- >-#KVH >-# Create a new directory to store all the distfile links. >-# settings["SRC_LINKS"]=settings["PORTAGE_TMPDIR"]+"/source-links" >- if not listonly and not fetchonly: >-# print "^^^ "+myfile+" is located in "+filedir >- target = filedir + "/" + myfile >- dest = settings["SRC_LINKS"] + "/" + myfile >-# print "^^^ "+target+" --> "+dest >- try: >- os.symlink(target,dest) >- except Exception, e: >- # Should not happen since we clear out the directory above. >- # May already exists...should likely ignore errors here... >- print "^^^ Error : "+dest+ " already exists! (ignore)" >- > return 1 > > >@@ -1385,11 +1294,8 @@ > """generates digest file if missing. Assumes all files are available. If > overwrite=0, the digest will only be created if it doesn't already exist.""" > >-# KVH - Change basedir to SRC_LINKS >-# basedir=settings["DISTDIR"]+"/" >- basedir=settings["SRC_LINKS"]+"/" >- > # archive files >+ basedir=settings["DISTDIR"]+"/" > digestfn=settings["FILESDIR"]+"/digest-"+settings["PF"] > > # portage files -- p(ortagefiles)basedir >@@ -1615,27 +1521,11 @@ > retval=spawnebuild(actionmap[mydo]["dep"],actionmap,debug,alwaysdep) > if retval: > return retval >- >-#KVH >- settings["ODISTDIR"]=settings["DISTDIR"] >- settings["DISTDIR"]=settings["SRC_LINKS"] >- >-# print "^^^ Current [DISTDIR] "+settings["DISTDIR"] >- # spawn ebuild.sh >- mycommand="/usr/sbin/ebuild.sh " >- ret=spawn(mycommand + mydo,debug, >- actionmap[mydo]["args"][0], >- actionmap[mydo]["args"][1]) >- >- settings["DISTDIR"]=settings["ODISTDIR"] >- >- return ret >- > # spawn ebuild.sh >-# mycommand="/usr/sbin/ebuild.sh " >-# return spawn(mycommand + mydo,debug, >-# actionmap[mydo]["args"][0], >-# actionmap[mydo]["args"][1]) >+ mycommand="/usr/sbin/ebuild.sh " >+ return spawn(mycommand + mydo,debug, >+ actionmap[mydo]["args"][0], >+ actionmap[mydo]["args"][1]) > > def doebuild(myebuild,mydo,myroot,debug=0,listonly=0,fetchonly=0): > global settings
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 27669
:
16870
|
16875
|
18929
|
18931
|
19594