summaryrefslogtreecommitdiffstats
path: root/pym/portage/dispatch_conf.py
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-06-23 10:58:09 +0000
committerZac Medico <zmedico@gentoo.org>2007-06-23 10:58:09 +0000
commitcfe5e7bc23c30dc40b90c1f61282d8f59430840a (patch)
tree79b41326afb062e1f3c5855917fc2a0dd40b5a13 /pym/portage/dispatch_conf.py
parent0c93a2b77653ee55957e95b580d457459c4d5ab5 (diff)
downloadportage-cfe5e7bc23c30dc40b90c1f61282d8f59430840a.tar.gz
portage-cfe5e7bc23c30dc40b90c1f61282d8f59430840a.tar.bz2
portage-cfe5e7bc23c30dc40b90c1f61282d8f59430840a.zip
For bug #182964, replace os.rename() with shutil.move() in order to handle EXDEV errors that are triggered by layered filesystems.
svn path=/main/trunk/; revision=6967
Diffstat (limited to 'pym/portage/dispatch_conf.py')
-rw-r--r--pym/portage/dispatch_conf.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/pym/portage/dispatch_conf.py b/pym/portage/dispatch_conf.py
index 690772bf8..6df0146d5 100644
--- a/pym/portage/dispatch_conf.py
+++ b/pym/portage/dispatch_conf.py
@@ -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 @@ def rcs_archive(archive, curconf, newconf, mrgconf):
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 @@ def rcs_archive(archive, curconf, newconf, mrgconf):
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 @@ def file_archive(archive, curconf, newconf, mrgconf):
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 file_archive(archive, curconf, newconf, mrgconf):
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 rcs_archive_post_process(archive):
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')