IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 9, 2008, 11:04:07 AM (18 years ago)
Author:
eugene
Message:

rationalize workdir, tess_id, and dvodb

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippScripts/scripts/ipp_inject_fileset.pl

    r17558 r17604  
    5151my $pxinject = can_run('pxinject') or die "Can't find pxinject\n";
    5252
     53# tess_id needs to be an absolute path, or it must start with file://, path://, or neb://
     54if ($tess_id) {
     55    $tess_id = &fixpath ($tess_id);
     56}
     57
     58# dvodb needs to be an absolute path, or it must start with file://, path://, or neb://
     59if ($dvo_db) {
     60    $dvo_db = &fixpath ($dvo_db);
     61}
     62
    5363# workdir needs to be an absolute path, or it must start with file://, path://, or neb://
    5464if ($workdir) {
    55     my $valid = 0;
    56     $valid |= ($workdir =~ m|^file://|);
    57     $valid |= ($workdir =~ m|^path://|);
    58     $valid |= ($workdir =~ m|^neb://|);
    59     $valid |= ($workdir =~ m|^/|);
    60 
    61     if (!$valid) {
    62         $workdir = File::Spec->rel2abs( $workdir );
    63         print "adjust workdir to $workdir\n";
    64     }
     65    $workdir = &fixpath ($workdir);
    6566}
    6667
     
    104105$command_exp .= " -workdir $workdir";
    105106$command_exp .= " -reduction $reduction" if defined $reduction;
    106 $command_exp .= " -dvo_db $dvo_db"       if defined $dvo_db;
     107$command_exp .= " -dvodb $dvo_db"        if defined $dvo_db;
    107108$command_exp .= " -tess_id $tess_id"     if defined $tess_id;
    108109$command_exp .= " -end_stage $end_stage" if defined $end_stage;
     
    160161exit 0;
    161162
     163sub fixpath {
     164    my $path = shift;
     165    my $valid = 0;
     166    $valid |= ($path =~ m|^file://|);
     167    $valid |= ($path =~ m|^path://|);
     168    $valid |= ($path =~ m|^neb://|);
     169    $valid |= ($path =~ m|^/|);
     170
     171    if (!$valid) {
     172        $path = File::Spec->rel2abs( $path );
     173    }
     174    return $path;
     175}
     176
    162177__END__
Note: See TracChangeset for help on using the changeset viewer.