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