Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 75401 Details for
Bug 116511
portage: collision-protect doesn't protect against overwriting of symlinks
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Treat symlinks like regular files
sym-like-obj.patch (text/plain), 3.12 KB, created by
Jason Stubbs (RETIRED)
on 2005-12-23 10:48:37 UTC
(
hide
)
Description:
Treat symlinks like regular files
Filename:
MIME Type:
Creator:
Jason Stubbs (RETIRED)
Created:
2005-12-23 10:48:37 UTC
Size:
3.12 KB
patch
obsolete
>Index: pym/portage.py >=================================================================== >--- pym/portage.py (revision 2441) >+++ pym/portage.py (working copy) >@@ -5664,7 +5664,6 @@ > > #process symlinks second-to-last, directories last. > mydirs=[] >- mysyms=[] > modprotect="/lib/modules/" > for obj in mykeys: > obj=os.path.normpath(obj) >@@ -5688,7 +5687,7 @@ > > lstatobj=os.lstat(obj) > lmtime=str(lstatobj[stat.ST_MTIME]) >- if (pkgfiles[obj][0] not in ("dir","fif","dev","sym")) and (lmtime != pkgfiles[obj][1]): >+ if (pkgfiles[obj][0] not in ("dir","fif","dev")) and (lmtime != pkgfiles[obj][1]): > print "--- !mtime", pkgfiles[obj][0], obj > continue > >@@ -5701,7 +5700,11 @@ > if not os.path.islink(obj): > print "--- !sym ","sym", obj > continue >- mysyms.append(obj) >+ try: >+ os.unlink(obj) >+ print "<<< ","sym",obj >+ except (OSError,IOError),e: >+ print "!!! ","sym",obj > elif pkgfiles[obj][0]=="obj": > if not os.path.isfile(obj): > print "--- !obj ","obj", obj >@@ -5730,43 +5733,13 @@ > elif pkgfiles[obj][0]=="dev": > print "--- ","dev",obj > >- #Now, we need to remove symlinks and directories. We'll repeatedly >- #remove dead symlinks, then directories until we stop making progress. >- #This is how we'll clean up directories containing symlinks pointing to >- #directories that are now empty. These cases will require several >- #iterations through our two-stage symlink/directory cleaning loop. >- >- #main symlink and directory removal loop: >- > #progress -- are we making progress? Initialized to 1 so loop will start > progress=1 > while progress: > #let's see if we're able to make progress this iteration... > progress=0 > >- #step 1: remove all the dead symlinks we can... >- > pos = 0 >- while pos<len(mysyms): >- obj=mysyms[pos] >- if os.path.exists(obj): >- pos += 1 >- else: >- #we have a dead symlink; remove it from our list, then from existence >- del mysyms[pos] >- #we've made progress! >- progress = 1 >- try: >- os.unlink(obj) >- print "<<< ","sym",obj >- except (OSError,IOError),e: >- print "!!! ","sym",obj >- #immutable? >- pass >- >- #step 2: remove all the empty directories we can... >- >- pos = 0 > while pos<len(mydirs): > obj=mydirs[pos] > objld=listdir(obj) >@@ -5794,24 +5767,11 @@ > except (OSError,IOError),e: > #immutable? > pass >- #else: >- # print "--- !empty","dir", obj >- # continue > >- #step 3: if we've made progress, we'll give this another go... >- >- #step 4: otherwise, we'll print out the remaining stuff that we didn't unmerge (and rightly so!) >- > #directories that aren't empty: > for x in mydirs: > print "--- !empty dir", x > >- #symlinks whose target still exists: >- for x in mysyms: >- print "--- !targe sym", x >- >- #step 5: well, removal of package objects is complete, now for package *meta*-objects.... >- > #remove self from vartree database so that our own virtual gets zapped if we're the last node > db[self.myroot]["vartree"].zap(self.mycpv) >
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 116511
: 75401