From f308a597aef938c13d529f1b6d3f6a0fce2a69c5 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Thu, 22 Jun 2006 19:41:32 +0000 Subject: [PATCH] Use portage_exec.find_binary since "which" always returns 0 status on darwin. Thanks to exg for reporting. svn path=/main/trunk/; revision=3610 --- bin/dispatch-conf | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/bin/dispatch-conf b/bin/dispatch-conf index cd340a4f7..f5bf9e578 100755 --- a/bin/dispatch-conf +++ b/bin/dispatch-conf @@ -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 # -- 2.26.2