X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2Fcreate_prefix.pl;h=f1a0b554856f132be04df0a5b653f621ff6a440e;hb=fc8f1ff871c72c96e597c2d2ded8f7028eb7196f;hp=60d7d2a1f462861d60868da871dacf37b6bdaaec;hpb=4f1c00b0c181d994b13bb9b0ff9ea03ee0cf120c;p=spider.git diff --git a/perl/create_prefix.pl b/perl/create_prefix.pl index 60d7d2a1..f1a0b554 100755 --- a/perl/create_prefix.pl +++ b/perl/create_prefix.pl @@ -6,7 +6,7 @@ # # -require 5.004; +use 5.10.1; # search local then perl directories BEGIN { @@ -35,17 +35,21 @@ my %pre = (); # the prefix hash my %pren = (); # the inverse my $prefix; +my $system; -if (@ARGV && $ARGV[0] =~ /^--system$/) { +if (@ARGV && $ARGV[0] =~ /^-?-?syst?e?m?$/) { $prefix = $main::data; + ++$system; shift; + say "create_prefix.pl: creating SYSTEM prefix files"; } else { $prefix = $main::local_data; + say "create_prefix.pl: creating LOCAL prefix files"; } my $ifn; -$ifn = "$prefix/wpxloc.raw"; +$ifn = $system ? "$main::data/wpxloc.raw" : "$prefix/wpxloc.raw"; unless (open (IN, $ifn)) { $ifn = "$main::data/wpxloc.raw"; open(IN, $ifn) or die "can't open $ifn ($!)"; @@ -110,7 +114,7 @@ close(IN); # now open the cty.dat file if it is there my $r; -$ifn = "$prefix/cty.dat"; +$ifn = $system ? "$main::data/cty.dat" : "$prefix/cty.dat"; unless ($r = open (IN, $ifn)) { $ifn = "$main::data/cty.dat"; $r = open(IN, $ifn);