Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 28926 Details for
Bug 9849
mounted FS access/merge failures (baselayout)
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Same but supports new ebuild var NONCRITICAL_KEEPDIRS
portage-2.0.50-r4-keep.patch (text/plain), 4.63 KB, created by
Jason Stubbs (RETIRED)
on 2004-04-08 19:10:38 UTC
(
hide
)
Description:
Same but supports new ebuild var NONCRITICAL_KEEPDIRS
Filename:
MIME Type:
Creator:
Jason Stubbs (RETIRED)
Created:
2004-04-08 19:10:38 UTC
Size:
4.63 KB
patch
obsolete
>--- portage-orig/pym/portage.py 2004-04-08 12:21:06.000000000 +0900 >+++ portage/pym/portage.py 2004-04-09 10:55:49.433222280 +0900 >@@ -2472,7 +2472,11 @@ > try: > dstat=os.lstat(dest) > except: >- dstat=os.lstat(os.path.dirname(dest)) >+ try: >+ dstat=os.lstat(os.path.dirname(dest)) >+ # Parent directory does not exist >+ except: >+ return None > destexists=0 > > if destexists: >@@ -2516,8 +2520,6 @@ > import errno > if e[0]!=errno.EXDEV: > # Some random error. >- print "!!! Failed to move",src,"to",dest >- print "!!!",e > return None > # Invalid cross-device-link 'bind' mounted or actually Cross-Device > if renamefailed: >@@ -2532,8 +2534,6 @@ > os.rename(dest+"#new",dest) > didcopy=1 > except Exception, e: >- print '!!! copy',src,'->',dest,'failed.' >- print "!!!",e > return None > else: > #we don't yet handle special, so we need to fall back to /bin/mv >@@ -5712,7 +5712,9 @@ > # inforoot = root of db entry, > # secondhand = list of symlinks that have been skipped due to > # their target not existing (will merge later), >- >+ >+ self.failedkeeps = [] >+ > if not os.path.exists(self.dbcatdir): > os.makedirs(self.dbcatdir) > >@@ -5873,6 +5875,23 @@ > if dircache.has_key(self.dbcatdir): > del dircache[self.dbcatdir] > print ">>>",self.mycpv,"merged." >+ if self.failedkeeps: >+ self.failedkeeps.sort() >+ writemsg("\n!!! Creation of the following directories failed.\n") >+ writemsg("!!! Please adjust permissions and re-emerge this\n") >+ writemsg("!!! package or create the directories manually.\n") >+ for x in self.failedkeeps: >+ writemsg("!!! "+x+"\n") >+ if self.settings.has_key("NONCRITICAL_KEEPDIRS"): >+ for okpath in self.settings["NONCRITICAL_KEEPDIRS"].split(): >+ altpath = os.path.normpath(self.settings["ROOT"]+okpath) >+ for x in range(len(self.failedkeeps)-1,-1,-1): >+ if self.failedkeeps[x].startswith(okpath): >+ del self.failedkeeps[x] >+ elif self.failedkeeps[x].startswith(altpath): >+ del self.failedkeeps[x] >+ if self.failedkeeps: >+ sys.exit(1) > > > def new_protect_filename(self, mydest, newmd5=None): >@@ -6023,16 +6042,6 @@ > elif S_ISDIR(mymode): > # we are merging a directory > if mydmode!=None: >- # destination exists >- if not os.access(mydest, os.W_OK): >- pkgstuff = pkgsplit(self.pkg) >- writemsg("\n!!! Cannot write to '"+mydest+"'.\n") >- writemsg("!!! Please check permissions and directories for broken symlinks.\n") >- writemsg("!!! You may start the merge process again by using ebuild:\n") >- writemsg("!!! ebuild "+self.settings["PORTDIR"]+"/"+self.cat+"/"+pkgstuff[0]+"/"+self.pkg+".ebuild merge\n") >- writemsg("!!! And finish by running this: env-update\n\n") >- return 1 >- > if S_ISLNK(mydmode) or S_ISDIR(mydmode): > # a symlink to an existing directory will work for us; keep it: > print "---",mydest+"/" >@@ -6048,10 +6057,14 @@ > print ">>>",mydest+"/" > else: > #destination doesn't exist >- os.mkdir(mydest) >- os.chmod(mydest,mystat[0]) >- os.chown(mydest,mystat[4],mystat[5]) >- print ">>>",mydest+"/" >+ try: >+ os.mkdir(mydest) >+ os.chmod(mydest,mystat[0]) >+ os.chown(mydest,mystat[4],mystat[5]) >+ print ">>>",mydest+"/" >+ except OSError: >+ #Don't die here. Die when real files are attempted to be copied. >+ print "!!!",mydest+"/" > outfile.write("dir "+myrealdest+"\n") > # recurse and merge this directory > if self.mergeme(srcroot,destroot,outfile,secondhand,offset+x+"/",cfgfiledict,thismtime): >@@ -6119,8 +6132,26 @@ > if moveme: > mymtime=movefile(mysrc,mydest,thismtime,mystat, mysettings=self.settings) > if mymtime == None: >- sys.exit(1) >- zing=">>>" >+ #If it's a ".keep" file, simply report the failure. >+ if os.path.basename(mydest)==".keep": >+ dirname = os.path.dirname(mydest) >+ try: >+ os.lstat(dirname) >+ except: >+ self.failedkeeps.append(dirname) >+ zing="!!!" >+ #Otherwise directory permissions, >+ #mounts, whatever are preventing it. >+ else: >+ pkgstuff = pkgsplit(self.pkg) >+ writemsg("\n!!! Cannot write to '"+mydest+"'.\n") >+ writemsg("!!! Please check permissions and directories for broken symlinks.\n") >+ writemsg("!!! You may start the merge process again by using ebuild:\n") >+ writemsg("!!! ebuild "+self.settings["PORTDIR"]+"/"+self.cat+"/"+pkgstuff[0]+"/"+self.pkg+".ebuild merge\n") >+ writemsg("!!! And finish by running this: env-update\n\n") >+ sys.exit(1) >+ else: >+ zing=">>>" > else: > mymtime=thismtime > # We need to touch the destination so that on --update the
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 9849
:
18106
|
18614
|
28872
|
28874
| 28926 |
29121