Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 122886 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 shutil.move()
shutil_move.patch (text/plain), 4.70 KB, created by
Zac Medico
on 2007-06-23 11:13:58 UTC
(
hide
)
Description:
portage-2.1.3_rc5 patch to replace os.rename() with shutil.move()
Filename:
MIME Type:
Creator:
Zac Medico
Created:
2007-06-23 11:13:58 UTC
Size:
4.70 KB
patch
obsolete
>Index: pym/portage.py >=================================================================== >--- pym/portage.py (revision 6967) >+++ pym/portage.py (revision 6968) >@@ -5264,16 +5264,16 @@ > if os.path.exists(newpath): > #dest already exists; keep this puppy where it is. > continue >- os.rename(origpath, newpath) >+ shutil.move(origpath, newpath) > > # We need to rename the ebuild now. > old_pf = catsplit(mycpv)[1] > new_pf = catsplit(mynewcpv)[1] > if new_pf != old_pf: > try: >- os.rename(os.path.join(newpath, old_pf + ".ebuild"), >+ shutil.move(os.path.join(newpath, old_pf + ".ebuild"), > os.path.join(newpath, new_pf + ".ebuild")) >- except OSError, e: >+ except EnvironmentError, e: > if e.errno != errno.ENOENT: > raise > del e >@@ -6489,7 +6489,7 @@ > if e.errno != errno.EEXIST: > raise > del e >- os.rename(tbz2path, new_path) >+ shutil.move(tbz2path, new_path) > self._remove_symlink(mycpv) > if new_path.split(os.path.sep)[-2] == "All": > self._create_symlink(mynewcpv) >@@ -6587,7 +6587,7 @@ > if e.errno != errno.EEXIST: > raise > del e >- os.rename(src_path, os.path.join(self.pkgdir, "All", myfile)) >+ shutil.move(src_path, os.path.join(self.pkgdir, "All", myfile)) > self._create_symlink(cpv) > self._pkg_paths[cpv] = os.path.join("All", myfile) > >@@ -6605,7 +6605,7 @@ > if e.errno != errno.EEXIST: > raise > del e >- os.rename(os.path.join(self.pkgdir, "All", myfile), dest_path) >+ shutil.move(os.path.join(self.pkgdir, "All", myfile), dest_path) > self._pkg_paths[cpv] = mypath > > def populate(self, getbinpkgs=0,getbinpkgsonly=0): >@@ -7051,7 +7051,7 @@ > if x[:-7] != self.pkg: > # Clean up after vardbapi.move_ent() breakage in > # portage versions before 2.1.2 >- os.rename(os.path.join(self.dbdir, x), myebuildpath) >+ shutil.move(os.path.join(self.dbdir, x), myebuildpath) > write_atomic(os.path.join(self.dbdir, "PF"), self.pkg+"\n") > break > >Index: pym/dispatch_conf.py >=================================================================== >--- pym/dispatch_conf.py (revision 6967) >+++ pym/dispatch_conf.py (revision 6968) >@@ -7,7 +7,7 @@ > # Library by Wayne Davison <gentoo@blorf.net>, derived from code > # written by Jeremy Wohl (http://igmus.org) > >-from stat import * >+from stat import ST_GID, ST_MODE, ST_UID > import os, sys, commands, shutil > > import portage >@@ -72,7 +72,7 @@ > os.system(RCS_GET + ' -r' + RCS_BRANCH + ' ' + archive) > has_branch = os.path.exists(archive) > if has_branch: >- os.rename(archive, archive + '.dist') >+ shutil.move(archive, archive + '.dist') > > try: > shutil.copy2(newconf, archive) >@@ -87,7 +87,7 @@ > mystat = os.lstat(newconf) > os.chmod(mrgconf, mystat[ST_MODE]) > os.chown(mrgconf, mystat[ST_UID], mystat[ST_GID]) >- os.rename(archive, archive + '.dist.new') >+ shutil.move(archive, archive + '.dist.new') > return ret > > >@@ -112,10 +112,10 @@ > suf += 1 > > while suf > 1: >- os.rename(archive + '.' + str(suf-1), archive + '.' + str(suf)) >+ shutil.move(archive + '.' + str(suf-1), archive + '.' + str(suf)) > suf -= 1 > >- os.rename(archive, archive + '.1') >+ shutil.move(archive, archive + '.1') > > try: > shutil.copy2(curconf, archive) >@@ -145,7 +145,7 @@ > def rcs_archive_post_process(archive): > """Check in the archive file with the .dist.new suffix on the branch > and remove the one with the .dist suffix.""" >- os.rename(archive + '.dist.new', archive) >+ shutil.move(archive + '.dist.new', archive) > if os.path.exists(archive + '.dist'): > # Commit the last-distributed version onto the branch. > os.system(RCS_LOCK + RCS_BRANCH + ' ' + archive) >@@ -158,4 +158,4 @@ > > def file_archive_post_process(archive): > """Rename the archive file with the .dist.new suffix to a .dist suffix""" >- os.rename(archive + '.dist.new', archive + '.dist') >+ shutil.move(archive + '.dist.new', archive + '.dist') >Index: bin/emerge >=================================================================== >--- bin/emerge (revision 6967) >+++ bin/emerge (revision 6968) >@@ -3696,14 +3696,17 @@ > > icount=0 > badcount=0 >+ import shutil > for inforoot in regen_infodirs: > if inforoot=='': > continue > for filename in ("dir", "dir.gz", "dir.bz2"): > file_path = os.path.join(inforoot, filename) >+ if not os.path.exists(file_path): >+ continue > try: >- os.rename(file_path, file_path + ".old") >- except OSError, e: >+ shutil.move(file_path, file_path + ".old") >+ except EnvironmentError, e: > if e.errno != errno.ENOENT: > raise > del e
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