summaryrefslogtreecommitdiff
path: root/lib/sbin/checkout.pl
diff options
context:
space:
mode:
authorallen <allen@17b73243-c579-4c4c-a9d2-2d5706c11dac>1999-07-03 16:38:52 +0000
committerallen <allen@17b73243-c579-4c4c-a9d2-2d5706c11dac>1999-07-03 16:38:52 +0000
commit8cd6d1b92202368374ba7314638c0196a77af0d1 (patch)
tree7540df9277fd8f9b24bae4f6b976981bed95395f /lib/sbin/checkout.pl
parent44d46a97a5b036fc2b5c7a277935633b0231ecce (diff)
Script for checking out thorns and packages, needs to be modified
to use Toms "BuildActiveThorns" perl script to get a list of Thorns and Parameters already there. git-svn-id: http://svn.cactuscode.org/flesh/trunk@625 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'lib/sbin/checkout.pl')
-rw-r--r--lib/sbin/checkout.pl173
1 files changed, 173 insertions, 0 deletions
diff --git a/lib/sbin/checkout.pl b/lib/sbin/checkout.pl
new file mode 100644
index 00000000..34e01294
--- /dev/null
+++ b/lib/sbin/checkout.pl
@@ -0,0 +1,173 @@
+# /usr/bin/perl -s
+
+print "\n";
+
+
+ print "Checkout packages or thorns? [packages] : ";
+
+ $which = <STDIN>;
+
+ if ($which =~ /^t/i)
+ {
+ &get_thorns();
+ }
+ else
+ {
+ &get_packages();
+ }
+
+print "\nQuit or checkout more packages or thorns [quit] : ";
+$dowhat = <STDIN>;
+print $dowhat;
+if ($dowhat !~ /^t/i && $dowhat !~/^p/i)
+{
+ print "All done!\n";
+ exit;
+}
+
+$doit = 1;
+while ()
+{
+
+ if ($dowhat =~ /^t/i)
+ {
+ &get_thorns();
+ }
+ else
+ {
+ &get_packages();
+ }
+
+ print "\nQuit or checkout more packages or thorns [quit] : ";
+
+ $dowhat = <STDIN>;
+ if ($dowhat !~ /^t/i && $dowhat !~/^p/i)
+ {
+ print "All done!\n";
+ exit;
+ }
+}
+
+sub get_packages
+{
+
+
+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>;
+
+while ($range =~/^([0-9]+(?:-[0-9]+)?),?/)
+{
+ $range = $';
+ $1 =~ /^([0-9]*)(-[0-9]*)?$/;
+ $first = $1;
+ if (!$2)
+ {$last=$1}
+ else
+ {$2=~/-([0-9]*)/; $last=$1}
+
+ for ($i=$first; $i<$last+1; $i++)
+ {
+ system("(cd packages; cvs checkout $name{$i}, cd ..)");
+ }
+
+}
+}
+
+
+
+sub get_thorns
+{
+
+
+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)
+ {$last=$1}
+ else
+ {$2=~/-([0-9]*)/; $last=$1}
+
+ for ($i=$first; $i<$last+1; $i++)
+ {
+ system("(cd ./packages; cvs -q checkout $name{$i}; cd ..)");
+ }
+
+}
+}
+
+