Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 122922 Details for
Bug 182964
Portage should not fail if os.rename is across filesystem boundaries
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
portage-2.1.3_rc5 patch to replace os.rename() with portage.movefile() in cases where the parent directory might change
movefile.patch (text/plain), 2.23 KB, created by
Zac Medico
on 2007-06-24 00:41:59 UTC
(
hide
)
Description:
portage-2.1.3_rc5 patch to replace os.rename() with portage.movefile() in cases where the parent directory might change
Filename:
MIME Type:
Creator:
Zac Medico
Created:
2007-06-24 00:41:59 UTC
Size:
2.23 KB
patch
obsolete
>Index: pym/portage.py >=================================================================== >--- pym/portage.py (revision 6983) >+++ pym/portage.py (revision 6984) >@@ -3906,6 +3906,12 @@ > > expandcache={} > >+def _movefile(src, dest, **kwargs): >+ """Calls movefile and raises a PortageException if an error occurs.""" >+ if movefile(src, dest, **kwargs) is None: >+ raise portage_exception.PortageException( >+ "mv '%s' '%s'" % (src, dest)) >+ > def movefile(src,dest,newmtime=None,sstat=None,mysettings=None): > """moves a file from src to dest, preserving all permissions and attributes; mtime will > be preserved even when moving across filesystems. Returns true on success and false on >@@ -5264,7 +5270,7 @@ > if os.path.exists(newpath): > #dest already exists; keep this puppy where it is. > continue >- os.rename(origpath, newpath) >+ _movefile(origpath, newpath, mysettings=self.settings) > > # We need to rename the ebuild now. > old_pf = catsplit(mycpv)[1] >@@ -6489,7 +6495,7 @@ > if e.errno != errno.EEXIST: > raise > del e >- os.rename(tbz2path, new_path) >+ _movefile(tbz2path, new_path, mysettings=self.settings) > self._remove_symlink(mycpv) > if new_path.split(os.path.sep)[-2] == "All": > self._create_symlink(mynewcpv) >@@ -6587,7 +6593,8 @@ > if e.errno != errno.EEXIST: > raise > del e >- os.rename(src_path, os.path.join(self.pkgdir, "All", myfile)) >+ dest_path = os.path.join(self.pkgdir, "All", myfile) >+ _movefile(src_path, dest_path, mysettings=self.settings) > self._create_symlink(cpv) > self._pkg_paths[cpv] = os.path.join("All", myfile) > >@@ -6605,7 +6612,8 @@ > if e.errno != errno.EEXIST: > raise > del e >- os.rename(os.path.join(self.pkgdir, "All", myfile), dest_path) >+ src_path = os.path.join(self.pkgdir, "All", myfile) >+ _movefile(src_path, dest_path, mysettings=self.settings) > self._pkg_paths[cpv] = mypath > > def populate(self, getbinpkgs=0,getbinpkgsonly=0): >@@ -7684,7 +7692,7 @@ > # We hold both directory locks. > self.dbdir = self.dbpkgdir > self.delete() >- movefile(self.dbtmpdir, self.dbpkgdir, mysettings=self.settings) >+ _movefile(self.dbtmpdir, self.dbpkgdir, mysettings=self.settings) > contents = self.getcontents() > > #write out our collection of md5sums
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 182964
:
122877
|
122886
| 122922