IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 23, 2009, 8:13:45 AM (16 years ago)
Author:
eugene
Message:

added -only and -modules; updated help listing

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psconfig/pschecklibs

    r25008 r26271  
    1111$version = "";
    1212$build = 0;
     13$list_modules = 0;
     14my $only = "";
    1315my %force;
    1416my %done;                       # Tarballs that have been processed
     
    3537        shift; shift; next;
    3638    }
     39    if ($ARGV[0] eq "-only") {
     40        if (@ARGV < 2) { die "-only must be coupled to a library name\n"; }
     41        $only = lc($ARGV[1]);
     42        shift; shift; next;
     43    }
    3744    if ($ARGV[0] eq "-h")     { &usage (); }
    3845    if ($ARGV[0] eq "help")   { &usage (); }
     
    4047    if ($ARGV[0] eq "--help") { &usage (); }
    4148    if ($ARGV[0] eq "-list")  { &list_distributions(); }
     49    if ($ARGV[0] eq "-modules") { $list_modules = 1; shift; next; }
    4250    @tARGV = (@tARGV, $ARGV[0]);
    4351    shift;
     
    5866@list = <FILE>;
    5967close (FILE);
     68
     69if ($list_modules) { &list_modules(); }
    6070
    6171# set the psconfig version:
     
    146156    if (($auto_force ne "Y") && ($auto_force ne "N")) { die "invalid value for auto_force field\n"; }
    147157
     158    if ($only && ($only ne lc($name))) { next; }
    148159
    149160    if ((defined $force{lc($name)} or defined $force{'all'}) and
     
    501512
    502513sub usage {
    503     print STDERR "USAGE: pschecklibs [-version] [-build]\n";
     514    print STDERR "USAGE: pschecklibs [-version] [-build] [-only module] [-force module] [-force all]\n";
     515    print STDERR "  multiple [-force (module)] options may be specified\n";
     516    print STDERR "USAGE: pschecklibs [-list] : show C libraries file\n";
     517    print STDERR "USAGE: pschecklibs [-modules] : list available C modules\n";
    504518    exit 2;
    505519}
     
    521535}
    522536
     537sub list_modules {
     538
     539    foreach $line (@list) {
     540        chop $line;
     541        if ($line =~ m|^\s*$|) { next; }
     542        if ($line =~ m|^\s*\#|) { next; }
     543
     544        ($type, $name, $altnames, $altpaths, $tarball, $tardir, $auto_force, $configure_opts, $make_opts, $install_opts) = split (" ", $line);
     545        if ($type eq "bin") {
     546            print STDERR "bin: $name\n";
     547        }
     548        if ($type eq "lib") {
     549            print STDERR "lib: $name\n";
     550        }
     551    }
     552    exit 0;
     553}
     554
    523555sub failure {
    524556    system ("ls");
Note: See TracChangeset for help on using the changeset viewer.