For bug #8423, make dispatch-conf preserve timestamps when possible.
authorZac Medico <zmedico@gentoo.org>
Sun, 26 Nov 2006 14:14:01 +0000 (14:14 -0000)
committerZac Medico <zmedico@gentoo.org>
Sun, 26 Nov 2006 14:14:01 +0000 (14:14 -0000)
svn path=/main/trunk/; revision=5136

bin/dispatch-conf

index 6a007ab536771d5dbd8d65f5fb688035c9f0b030..28c471e9455abd1bfa0992b5d8d67e20e882ed7e 100755 (executable)
@@ -279,8 +279,7 @@ class dispatch:
         the diff of what changed into the configured log file."""
         os.system((DIFF_CONTENTS % (curconf, newconf)) + '>>' + self.options["log-file"])
         try:
-            shutil.copyfile(newconf, curconf)
-            os.remove(newconf)
+            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))