Changeset 30542
- Timestamp:
- Feb 9, 2011, 11:12:19 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tags/ipp-20101215/pstamp/scripts/pstamp_job_run.pl
- Property svn:mergeinfo set to
r30321 r30542 14 14 use File::Basename; 15 15 use File::Copy; 16 use File::Temp qw(tempfile );16 use File::Temp qw(tempfile tempdir); 17 17 use Digest::MD5::File qw( file_md5_hex ); 18 18 use PS::IPP::PStamp::RequestFile qw( :standard ); … … 144 144 } elsif (($options & $PSTAMP_REQUIRE_UNCENSORED) and ($stage ne 'chip')) { 145 145 # user required uncensored but since stage isn't chip we can't rebuild them 146 my_die("uncensored inputs not available for job $job_id", $job_id, $PSTAMP_NOT_AVAILABLE); 147 } elsif (($options & $PSTAMP_REQUEST_UNCENSORED) and ($stage ne 'chip')) { 146 my_die("uncensored inputs not available for job $job_id", $job_id, $PSTAMP_NOT_AVAILABLE, 'stop'); 147 } elsif (($options & $PSTAMP_REQUEST_UNCENSORED) and ($params->{state} eq 'update') and ($stage ne 'chip')) { 148 # we can only restore pixels for chip stage images if the data has been updated. 149 # XXX: this test is not quite good enough. If all components have been updated then the 150 # state will be 'full' But this will get us going. 151 print "Run state is update: will make stamps from destreaked $stage images.\n"; 148 152 # make stamps from uncensored images 149 153 $muggle = 0; … … 151 155 # Try and replace the streaks from the recovery images 152 156 153 @file_list = (); 154 $tmproot = "$outdir/$job_id"; 155 mkdir $tmproot or 156 my_die( "failed to create temporary directory $tmproot", $job_id, $PS_EXIT_UNKNOWN_ERROR); 157 my $temp_dir = metadataLookupStr($ipprc->{_siteConfig}, "TEMP.DIR") or &my_die("Unable to find temporary directory in site configuration", $job_id, $PS_EXIT_CONFIG_ERROR); 158 $tmproot = tempdir("$temp_dir/psjob.$job_id.XXXX", CLEANUP => !$save_temps); 157 159 my $muggle_command = "$streaksreplace -stage $stage -tmproot $tmproot"; 158 160 # find the "directory" of the input path_base … … 160 162 my $base = basename($image); 161 163 $tmpImage = "$tmproot/$base"; 164 165 @file_list = (); 162 166 163 167 # XXX: We should get the recovery_path_base from the magicDSFile but that requires a bunch of file rule and … … 180 184 $base = basename($variance); 181 185 $tmpVariance = "$tmproot/$base"; 182 $newFileArgs .= " - weight$tmpVariance";186 $newFileArgs .= " -variance $tmpVariance"; 183 187 my $recVariance = "$inputdir/REC_$base"; 184 188 $muggle_command .= " -weight $variance -recweight $recVariance"; … … 225 229 } 226 230 227 if (!$save_temps) {228 unlink $tmpImage if $tmpImage;229 unlink $tmpMask if $tmpMask;230 unlink $tmpVariance if $tmpVariance;231 rmdir $tmproot if $tmproot;232 }233 234 231 if ($exitStatus == 0) { 235 232 my $reglist = "$outdir/reglist$job_id";
Note:
See TracChangeset
for help on using the changeset viewer.
