diff options
author | allen <allen@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 1999-07-04 12:33:45 +0000 |
---|---|---|
committer | allen <allen@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 1999-07-04 12:33:45 +0000 |
commit | 01f356b3dda9d3a4d857a1a0ebe58583dc55bbde (patch) | |
tree | 759406061e5df1a15d2cf33cf4ae0857b5750730 /lib/sbin/checkout.pl | |
parent | b6a387ddb006befdf3bc427d34ea2af67adc7d5c (diff) |
This now uses BuildActiveThorns to get the thorn and package lists.
git-svn-id: http://svn.cactuscode.org/flesh/trunk@631 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'lib/sbin/checkout.pl')
-rw-r--r-- | lib/sbin/checkout.pl | 210 |
1 files changed, 97 insertions, 113 deletions
diff --git a/lib/sbin/checkout.pl b/lib/sbin/checkout.pl index 34e01294..e40ed10f 100644 --- a/lib/sbin/checkout.pl +++ b/lib/sbin/checkout.pl @@ -1,20 +1,23 @@ # /usr/bin/perl -s -print "\n"; +$sbin_dir = "lib/sbin"; + +require "$sbin_dir/MakeUtils.pl"; +print "\n"; - print "Checkout packages or thorns? [packages] : "; +print "Checkout packages or thorns? [packages] : "; - $which = <STDIN>; +$which = <STDIN>; - if ($which =~ /^t/i) - { - &get_thorns(); - } - else - { - &get_packages(); - } +if ($which =~ /^t/i) +{ + &get_thorns(); +} +else +{ + &get_packages(); +} print "\nQuit or checkout more packages or thorns [quit] : "; $dowhat = <STDIN>; @@ -51,123 +54,104 @@ while () sub get_packages { + print "\nYou already have packages: \n\n"; -print "\nYou already have packages: \n"; - -open(HAVE,"find ./packages -type d -maxdepth 1 |"); -while (<HAVE>) -{ - if (!/^\.\/CVS$/ && !/^\.$/) - { - /\.\/(.*)/; - print " $1\n"; - } -} - -print "\nAvailable packages: \n"; - -open(MODULES,"cvs co -s | "); - -$count = 0; -while(<MODULES>) -{ - if (/(\w*)\s*PACKAGE/) - { - $count++; - $name{$count} = $1; - } -} - - -for ($i=1; $i<$count+1;$i++) -{ - print " [$i] $name{$i}\n"; -} - -print "\n"; - -print "Checkout packages [1-$count] : "; - -$range = <STDIN>; + &buildthorns("packages/","packages"); + + print "\nAvailable packages: \n"; -while ($range =~/^([0-9]+(?:-[0-9]+)?),?/) -{ - $range = $'; - $1 =~ /^([0-9]*)(-[0-9]*)?$/; - $first = $1; - if (!$2) + open(MODULES,"cvs co -s | "); + + $count = 0; + while(<MODULES>) + { + if (/(\w*)\s*PACKAGE/) + { + $count++; + $name{$count} = $1; + } + } + + + for ($i=1; $i<$count+1;$i++) + { + print " [$i] $name{$i}\n"; + } + + print "\n"; + + print "Checkout packages [1-$count] : "; + + $range = <STDIN>; + + while ($range =~/^([0-9]+(?:-[0-9]+)?),?/) + { + $range = $'; + $1 =~ /^([0-9]*)(-[0-9]*)?$/; + $first = $1; + if (!$2) {$last=$1} - else + else {$2=~/-([0-9]*)/; $last=$1} - - for ($i=$first; $i<$last+1; $i++) - { - system("(cd packages; cvs checkout $name{$i}, cd ..)"); - } - -} + + for ($i=$first; $i<$last+1; $i++) + { + system("(cd packages; cvs checkout $name{$i}, cd ..)"); + } + + } } sub get_thorns { + print "\nYou already have thorns: \n\n"; + + &buildthorns("packages/","thorns"); + + print "\nAvailable thorns: \n"; + open(MODULES,"cvs -q co -s | "); + + $count = 0; + while(<MODULES>) + { + if (/(\w*\/?\w*)\s*THORN/) + { + $count++; + $name{$count} = $1; + } + } -print "\nYou already have thorns: \n"; - -open(HAVE,"find ./packages -type d -maxdepth 2 |"); -while (<HAVE>) -{ - if (!/CVS$/ && /\.\/\w*\/\w*$/) - { - /\.\/(.*)/; - print " $1\n"; - } -} - -print "\nAvailable thorns: \n"; - -open(MODULES,"cvs -q co -s | "); - -$count = 0; -while(<MODULES>) -{ - if (/(\w*\/?\w*)\s*THORN/) - { - $count++; - $name{$count} = $1; - } -} - - -for ($i=1; $i<$count+1;$i++) -{ - print " [$i] $name{$i}\n"; -} - -print "\n"; - -print "Checkout thorns [1-$count] : "; - -$range = <STDIN>; -while ($range =~/^([0-9]+(?:-[0-9]+)?),?/) -{ - $range = $'; - $1 =~ /^([0-9]*)(-[0-9]*)?$/; - $first = $1; - if (!$2) + for ($i=1; $i<$count+1;$i++) + { + print " [$i] $name{$i}\n"; + } + + print "\n"; + + print "Checkout thorns [1-$count] : "; + + $range = <STDIN>; + + while ($range =~/^([0-9]+(?:-[0-9]+)?),?/) + { + $range = $'; + $1 =~ /^([0-9]*)(-[0-9]*)?$/; + $first = $1; + if (!$2) {$last=$1} - else + else {$2=~/-([0-9]*)/; $last=$1} - - for ($i=$first; $i<$last+1; $i++) - { - system("(cd ./packages; cvs -q checkout $name{$i}; cd ..)"); - } - -} + + for ($i=$first; $i<$last+1; $i++) + { + system("(cd ./packages; cvs -q checkout $name{$i}; cd ..)"); + } + + } } |