summaryrefslogtreecommitdiff
path: root/lib/sbin/ThornList.pl
diff options
context:
space:
mode:
authorikelley <ikelley@17b73243-c579-4c4c-a9d2-2d5706c11dac>2002-08-19 18:39:34 +0000
committerikelley <ikelley@17b73243-c579-4c4c-a9d2-2d5706c11dac>2002-08-19 18:39:34 +0000
commitfdeb58dacfa4cb436378ef8ad0e15953d731c42a (patch)
tree2d9f78a06b2b06a284f0af56cbde0be2cee4b70d /lib/sbin/ThornList.pl
parentad7c4fe8e561b76f5de7a9be9abbe101bdc90dae (diff)
added support for -thorns= and -arrangements= (comma separated lists), should not effect current behaviour
git-svn-id: http://svn.cactuscode.org/flesh/trunk@2968 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'lib/sbin/ThornList.pl')
-rw-r--r--lib/sbin/ThornList.pl52
1 files changed, 44 insertions, 8 deletions
diff --git a/lib/sbin/ThornList.pl b/lib/sbin/ThornList.pl
index 0503f108..f4e9f48f 100644
--- a/lib/sbin/ThornList.pl
+++ b/lib/sbin/ThornList.pl
@@ -1,5 +1,7 @@
#!/usr/bin/perl
+# use vars qw($arrangements_dir $arrangements $thorns $h $help $thornlist);
+
#/*@@
# @file ThornList.pl
# @date March 2001
@@ -18,32 +20,65 @@ if ($h || $help) {
print <<EOC;
--> ThornList.pl <--
-Either creates a stripped down thornlist of all thorns in the arrangments directory, or prints out the full paths to each thorn on a single line
+Either creates a stripped down thornlist of all thorns in the arrangments directory, or prints out the full paths to each thorn on a single line. It can also take a combination of arrangements and thorns and will print them all out as a thornlist.
Usage:
-\t\$ perl -s ThornList.pl -arrangements_dir=/home/ikelley/Cactus/WaveToyC_Dev/arrangements > allthorns.th
-\t\$ perl -s ThornList.pl -arrangements_dir=/home/ikelley/Cactus/WaveToyC_Dev/arrangements -thornlist=allthorns.th
+\t\$ perl -s ThornList.pl -arrangements_dir=/tmp/Cactus/arrangements > allthorns.th
+\t\$ perl -s ThornList.pl -arrangements_dir=/tmp/Cactus/arrangements -thornlist=allthorns.th
+\t\$ perl -s ThornList.pl -arrangements_dir=/tmp/Cactus/arrangements -thorns="CactusBase/Boundary CactusBase/IOBasic" -arrangements="CactusTest"
EOC
exit 0;
}
+my $start_directory = `pwd`;
+chomp ($start_directory);
+
+my @thorns;
+my @arrangements;
+
+
if (! defined $arrangements_dir) {
die "\nArrangements directory not defined (-arrangments_dir)";
-} elsif ($arrangments_dir !~ /\/$/) {
+} elsif ($arrangements_dir !~ /\/$/) {
$arrangements_dir .= '/';
}
+
+# if we are being passed in the arrangements or thorns manually
+if ($arrangements =~ /\w/ || $thorns =~ /\w/) {
+ if (defined $arrangements) {
+ @arrangements = split/,/, $arrangements;
+
+ foreach my $arrangement (@arrangements)
+ {
+ @thorns = &FindDirectories("$arrangements_dir$arrangement");
+
+ foreach my $thorn (@thorns) {
+ print "\n$arrangement/$thorn" if ($thorn ne "doc");
+ }
+ }
+ }
+
+ if (defined $thorns) {
+ @thorns = split/,/, $thorns;
+
+ foreach my $thorn (@thorns) {
+ print "\n$thorn";
+ }
+ }
+
+}
# if we are building a thornlist from thorns in $arrangements_dir
-if (! defined $thornlist)
+elsif (! defined $thornlist)
{
@arrangements = &FindDirectories($arrangements_dir);
- foreach $arrangement (@arrangements)
+ foreach my $arrangement (@arrangements)
{
@thorns = &FindDirectories("$arrangements_dir$arrangement");
- foreach $thorn (@thorns) {
+ foreach my $thorn (@thorns) {
print "\n$arrangement/$thorn" if ($thorn ne "doc");
}
}
@@ -52,7 +87,7 @@ if (! defined $thornlist)
# for use by the ThornGuide makefile
else
{
- $thorn_paths = "";
+ my $thorn_paths = "";
open (THORNLIST, "<$thornlist") || die "\nCannot open thornlist ($thornlist): $!";
@@ -87,6 +122,7 @@ else
sub FindDirectories
{
my (@good_directories);
+ my $name;
chdir ("$start_directory") || die "\nCannot chdir to $start_directory: $!";