For bug #129670, skip the replace-cvs and replace-wscomments tests if the diff exit...
authorZac Medico <zmedico@gentoo.org>
Wed, 1 Nov 2006 09:39:12 +0000 (09:39 -0000)
committerZac Medico <zmedico@gentoo.org>
Wed, 1 Nov 2006 09:39:12 +0000 (09:39 -0000)
svn path=/main/trunk/; revision=4901

bin/dispatch-conf

index c9f3655f01f289943ab2773a4d5aaac0912830ca..6a007ab536771d5dbd8d65f5fb688035c9f0b030 100755 (executable)
@@ -140,9 +140,18 @@ class dispatch:
             else:
                 newconf = conf['new']
 
-            same_file = len(commands.getoutput (DIFF_CONTENTS   % (conf ['current'], newconf))) == 0
-            same_cvs  = len(commands.getoutput (DIFF_CVS_INTERP % (conf ['current'], newconf))) == 0
-            same_wsc  = len(commands.getoutput (DIFF_WSCOMMENTS % (conf ['current'], newconf))) == 0
+            mystatus, myoutput = commands.getstatusoutput(
+                DIFF_CONTENTS  % (conf ['current'], newconf))
+            same_file = 0 == len(myoutput)
+            if mystatus >> 8 == 2:
+                # Binary files differ
+                same_cvs = False
+                same_wsc = False
+            else:
+                same_cvs = 0 == len(commands.getoutput(
+                    DIFF_CVS_INTERP % (conf ['current'], newconf)))
+                same_wsc = 0 == len(commands.getoutput(
+                    DIFF_WSCOMMENTS % (conf ['current'], newconf)))
 
             # Do options permit?
             same_cvs = same_cvs and self.options['replace-cvs'] == 'yes'