diff options
author | allen <allen@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 1999-11-04 18:52:29 +0000 |
---|---|---|
committer | allen <allen@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 1999-11-04 18:52:29 +0000 |
commit | 67a5d43141539e6048ff9e7d061e9f43125e93b3 (patch) | |
tree | f649eabf0d9c6a3299f7baeb820610e9b0b7828f /lib | |
parent | 9ffd41f23935e25e9950a57239f89da417a6cd2f (diff) |
Tom's beautification of my RepositoryExists subroutine
git-svn-id: http://svn.cactuscode.org/flesh/trunk@1133 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'lib')
-rw-r--r-- | lib/sbin/checkout.pl | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/lib/sbin/checkout.pl b/lib/sbin/checkout.pl index ca68fac0..3aa52bbd 100644 --- a/lib/sbin/checkout.pl +++ b/lib/sbin/checkout.pl @@ -434,6 +434,7 @@ sub choose_repository { print "Custom repository : "; $rep[2] = <STDIN>; + chop($rep[2]); } if ($dowhat !~ /^h/i) @@ -476,20 +477,13 @@ sub CVSFound sub RepositoryExists { my($repository) = @_; - my($existsif); + my $dummy; - $existsif = 0; - open(MODULES,"cvs -d $repository co -s | "); - while (<MODULES>) - { - if (/Cactus/) - { - $existsif = 1; - last; - } - } + open(MODULES,"cvs -d $_[0] co -s |"); + $dummy = <MODULES>; close(MODULES); - return $existsif; + return !$?; + } |