Use portage_exec.find_binary since "which" always returns 0 status on darwin. Thanks...
authorZac Medico <zmedico@gentoo.org>
Thu, 22 Jun 2006 19:41:32 +0000 (19:41 -0000)
committerZac Medico <zmedico@gentoo.org>
Thu, 22 Jun 2006 19:41:32 +0000 (19:41 -0000)
svn path=/main/trunk/; revision=3610

bin/dispatch-conf

index cd340a4f7d73a38fd5e1bbdb446837d4713b733c..f5bf9e5786f46374bc68bad9dac01664a6208761 100755 (executable)
@@ -18,6 +18,7 @@ import os, shutil, sys, string, re, commands, atexit
 sys.path = ["/usr/lib/portage/pym"]+sys.path
 
 import portage, dispatch_conf
+from portage_exec import find_binary
 
 FIND_EXTANT_CONFIGS  = "find %s/ -iname '._cfg????_*' | sed -e 's://:/:g'"
 DIFF_CONTENTS        = 'diff -Nu %s %s'
@@ -83,12 +84,13 @@ class dispatch:
 
             confs += self.massage (os.popen (FIND_EXTANT_CONFIGS % (path,)).readlines ())
 
-        if self.options['use-rcs'] == 'yes' and ((os.system( "which rcs >/dev/null 2>&1" ) == 256)
-                                                 or (os.system( "which ci >/dev/null 2>&1" ) == 256)
-                                                 or (os.system( "which co >/dev/null 2>&1" ) == 256) 
-                                                 or (os.system( "which rcsmerge >/dev/null 2>&1" ) == 256)):
-            print >> sys.stderr, 'dispatch-conf: Error finding all RCS utils and use-rcs=yes in config; fatal'
-            return False
+        if self.options['use-rcs'] == 'yes':
+            for rcs_util in ("rcs", "ci", "co", "rcsmerge"):
+                if not find_binary(rcs_util):
+                    print >> sys.stderr, \
+                        'dispatch-conf: Error finding all RCS utils and " + \
+                        "use-rcs=yes in config; fatal'
+                    return False
 
 
         #