--- dispatch-conf.ORIGINAL 2004-09-01 19:54:18.000000000 +0200 +++ dispatch-conf.NEW 2004-09-01 19:57:04.000000000 +0200 @@ -14,7 +14,7 @@ # from stat import * -import os, sys, string, re, commands +import os, sys, string, re, commands, shutil sys.path = ["/usr/lib/portage/pym"]+sys.path import portage, dispatch_conf @@ -37,7 +37,7 @@ count = 0 if os.path.exists(LOG_CHANGES_TO): - os.rename(LOG_CHANGES_TO, LOG_CHANGES_TO + '.old') + shutil.move(LOG_CHANGES_TO, LOG_CHANGES_TO + '.old') self.options = dispatch_conf.read_config(MANDATORY_OPTS) @@ -150,7 +150,7 @@ merged = '/tmp/dispatch-conf.merged.%i' % (os.getpid (),) print os.system (MERGE % (merged, conf ['current'], newconf)) - os.rename (merged, mrgconf) + shutil.move (merged, mrgconf) mystat = os.lstat(conf['new']) os.chmod(mrgconf, mystat[ST_MODE]) os.chown(mrgconf, mystat[ST_UID], mystat[ST_GID]) @@ -184,7 +184,7 @@ the diff of what changed into the LOG_CHANGES_TO file.""" os.system((DIFF_CONTENTS % (curconf, newconf)) + '>>' + LOG_CHANGES_TO) try: - os.rename (newconf, curconf) + shutil.move (newconf, curconf) except (IOError, os.error), why: print >> sys.stderr, 'dispatch-conf: Error renaming %s to %s: %s; fatal' % \ (newconf, curconf, str(why))