diff options
Diffstat (limited to 'pym/portage/dispatch_conf.py')
-rw-r--r-- | pym/portage/dispatch_conf.py | 14 |
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') |