IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 15, 2021, 8:39:19 AM (5 years ago)
Author:
eugene
Message:

add option to require exact version match

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psconfig/pscheckmods

    r40672 r41583  
    77    shift @ARGV;
    88}
    9 if (@ARGV > 2 && $ARGV[0] eq "-debug") {
    10     $DEBUG = 1;
    11     shift @ARGV;
    12 }
    13 if (@ARGV != 2) { die "USAGE: pscheckmods [-v] [-debug] (module) (version)\n"; }
     9if (@ARGV != 2) { die "USAGE: pscheckmods (module) (version)\n"; }
    1410
    1511if ($VERBOSE) { print STDERR "checking in @INC\n"; }
     
    2824print "$ARGV[0]: $version\n";
    2925
    30 if ($ARGV[1] > $version) {
     26my $requireExact = 0;
     27my $myVersion = $ARGV[1];
     28if ($myVersion =~ m|^=.|) {
     29    $requireExact = 1;
     30    $myVersion =~ s|^=||;
     31    print "$ARGV[1], $myVersion\n";
     32}
     33
     34if ($myVersion > $version) {
    3135    print "$ARGV[0] is too old: have $version : need $ARGV[1]\n";
    3236    exit 1;
    3337}
     38
     39if ($requireExact && ($myVersion != $version)) {
     40    print "$ARGV[0] is not the right version: have $version : need $myVersion\n";
     41    exit 1;
     42}
     43
    3444
    3545exit 0;
     
    4959          print "real: $realfilename\n" if $DEBUG;
    5060          if (-f $realfilename) {
    51               print "my filename: $filename\n" if $DEBUG;
    5261              $INC{$filename} = $realfilename;
    5362              print "calling 'do' on $realfilename\n" if $DEBUG;
Note: See TracChangeset for help on using the changeset viewer.