Add a 'ignore-previously-merged' config option which gives similar behavior to the...
authorZac Medico <zmedico@gentoo.org>
Wed, 23 May 2007 10:43:38 +0000 (10:43 -0000)
committerZac Medico <zmedico@gentoo.org>
Wed, 23 May 2007 10:43:38 +0000 (10:43 -0000)
svn path=/main/trunk/; revision=6592

bin/dispatch-conf
cnf/dispatch-conf.conf

index a62a0ef40d74e4b35cf7acb0e3fdb3a9519b135f..816de0de3480645e41cb0c70ac8cbe6d0965eeff 100755 (executable)
@@ -141,6 +141,14 @@ class dispatch:
             else:
                 newconf = conf['new']
 
+            if newconf == mrgconf and \
+                self.options.get('ignore-previously-merged') != 'yes' and \
+                len(commands.getoutput(DIFF_CONTENTS % (conf['current'], mrgconf))) == 0:
+                # The current update is identical to the archived .dist
+                # version that has previously been merged.
+                os.unlink(mrgconf)
+                newconf = conf['new']
+
             mystatus, myoutput = commands.getstatusoutput(
                 DIFF_CONTENTS  % (conf ['current'], newconf))
             same_file = 0 == len(myoutput)
index b1ece73bb5f1eb13561fa19037c07705a71e5bb8..d4caa95579f47b47086b091ca43ddee378556635 100644 (file)
@@ -32,6 +32,11 @@ replace-wscomments=no
 # (yes or no)
 replace-unmodified=no
 
+# Ignore a version that is identical to the previously merged version,
+# even though it is different from the current user modified version
+# (yes or no)
+ignore-previously-merged=yes
+
 # Per-session log file of changes made to configuration files
 #log-file=/var/log/dispatch-conf.log