Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 22291 Details for
Bug 35931
[patch] unmerge speedup (and fix?)
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
unmerge-speedup--with-normalization.patch
unmerge-speedup--with-normalization.patch (text/plain), 3.94 KB, created by
TGL
on 2003-12-16 05:03:22 UTC
(
hide
)
Description:
unmerge-speedup--with-normalization.patch
Filename:
MIME Type:
Creator:
TGL
Created:
2003-12-16 05:03:22 UTC
Size:
3.94 KB
patch
obsolete
>--- pym.orig/portage.py 2003-12-10 23:44:34.000000000 +0100 >+++ pym/portage.py 2003-12-13 17:35:28.000000000 +0100 >@@ -4918,9 +4937,33 @@ > sys.exit(123) > > if pkgfiles: >- mykeys=pkgfiles.keys() >- mykeys.sort() >- mykeys.reverse() >+ #unmerge-speedup: filter pkgfiles to remove obviously non-existing objects. >+ # Should be useful for unmerging already deleted kernel sources trees, etc. >+ myorigkeys=pkgfiles.keys() >+ mynormdict={} >+ for realobj in myorigkeys: >+ obj=os.path.normpath(realobj) >+ if obj[:2]=="//": >+ obj=obj[1:] >+ mynormdict[obj]=realobj >+ mynormkeys=mynormdict.keys() >+ mynormkeys.sort() >+ mykeys=[] >+ while len(mynormkeys): >+ obj=mynormkeys.pop(0) >+ mykeys[:0]=[obj] >+ realobj=mynormdict[obj] >+ if pkgfiles[realobj][0]=="dir" and not os.path.exists(obj): >+ # non existing dir -> forget his contents >+ while len(mynormkeys): >+ nextobj=mynormkeys[0] >+ if nextobj[:len(obj)+1]==obj+"/": >+ # this is some contents >+ del mynormkeys[0] >+ del mynormdict[nextobj] >+ else: >+ # end of the contents >+ break > > self.updateprotect() > >@@ -4929,15 +4973,13 @@ > mysyms=[] > modprotect="/lib/modules/" > for obj in mykeys: >- obj=os.path.normpath(obj) >- if obj[:2]=="//": >- obj=obj[1:] >+ realobj=mynormdict.pop(obj) > if not os.path.exists(obj): > if not os.path.islink(obj): > #we skip this if we're dealing with a symlink > #because os.path.exists() will operate on the > #link target rather than the link itself. >- print "--- !found "+str(pkgfiles[obj][0]), obj >+ print "--- !found "+str(pkgfiles[realobj][0]), obj > continue > # next line includes a tweak to protect modules from being unmerged, > # but we don't protect modules from being overwritten if they are >@@ -4945,33 +4987,33 @@ > # functionality for /lib/modules. For portage-ng both capabilities > # should be able to be independently specified. > if self.isprotected(obj) or ((len(obj) > len(modprotect)) and (obj[0:len(modprotect)]==modprotect)): >- print "--- cfgpro "+str(pkgfiles[obj][0]), obj >+ print "--- cfgpro "+str(pkgfiles[realobj][0]), obj > continue > > lstatobj=os.lstat(obj) > lmtime=str(lstatobj[ST_MTIME]) >- if (pkgfiles[obj][0] not in ("dir","fif","dev","sym")) and (lmtime != pkgfiles[obj][1]): >- print "--- !mtime", pkgfiles[obj][0], obj >+ if (pkgfiles[realobj][0] not in ("dir","fif","dev","sym")) and (lmtime != pkgfiles[realobj][1]): >+ print "--- !mtime", pkgfiles[realobj][0], obj > continue > >- if pkgfiles[obj][0]=="dir": >+ if pkgfiles[realobj][0]=="dir": > if not os.path.isdir(obj): > print "--- !dir ","dir", obj > continue > mydirs.append(obj) >- elif pkgfiles[obj][0]=="sym": >+ elif pkgfiles[realobj][0]=="sym": > if not os.path.islink(obj): > print "--- !sym ","sym", obj > continue > mysyms.append(obj) >- elif pkgfiles[obj][0]=="obj": >+ elif pkgfiles[realobj][0]=="obj": > if not os.path.isfile(obj): > print "--- !obj ","obj", obj > continue > mymd5=perform_md5(obj, calc_prelink=1) > # string.lower is needed because db entries used to be in upper-case. The > # string.lower allows for backwards compatibility. >- if mymd5 != string.lower(pkgfiles[obj][2]): >+ if mymd5 != string.lower(pkgfiles[realobj][2]): > print "--- !md5 ","obj", obj > continue > try: >@@ -4979,7 +5021,7 @@ > except (OSError,IOError),e: > pass > print "<<< ","obj",obj >- elif pkgfiles[obj][0]=="fif": >+ elif pkgfiles[realobj][0]=="fif": > if not S_ISFIFO(lstatobj[ST_MODE]): > print "--- !fif ","fif", obj > continue >@@ -4988,7 +5030,7 @@ > except (OSError,IOError),e: > pass > print "<<< ","fif",obj >- elif pkgfiles[obj][0]=="dev": >+ elif pkgfiles[realobj][0]=="dev": > print "--- ","dev",obj > > #Now, we need to remove symlinks and directories. We'll repeatedly
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 35931
:
22290
| 22291