Changeset 9468
- Timestamp:
- Oct 10, 2006, 1:20:02 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/ippScripts/scripts/phase0_imfile.pl (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/phase0_imfile.pl
r9446 r9468 11 11 use PS::IPP::Metadata::Stats; 12 12 use Data::Dumper; 13 use Cache::File; 13 14 14 15 use PS::IPP::Config; … … 19 20 use Pod::Usage qw( pod2usage ); 20 21 21 my ($ exp_tag, $class_id, $uri, $no_update);22 my ($cache, $exp_tag, $class_id, $uri, $no_update); 22 23 23 24 GetOptions( 24 'exp_tag|e=s' => \$exp_tag, 25 'caches' => \$cache, 26 'exp_tag|e=s' => \$exp_tag, 25 27 'class_id|i=s' => \$class_id, 26 28 'uri|u=s' => \$uri, … … 74 76 die "Can't find required tools.\n" if $missing_tools; 75 77 78 # setup cache interface 79 80 my $c = Cache::File->new( 81 cache_root => File::Spec->catdir($ENV{'HOME'}, '.pxcache'), 82 default_expires => '7200 sec', 83 ); 84 76 85 # Resolve the input URI 77 86 $uri = File::Spec->rel2abs( $uri, $ipprc->workdir() ); … … 81 90 { 82 91 my $command = "$ppStats $uri -recipe PPSTATS " . RECIPE; # Command to run ppStats 83 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 84 run(command => $command, verbose => 1); 85 die "Unable to perform ppStats on exposure id $exp_tag: $error_code\n" if not $success; 92 93 ### cache hook 94 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ); 95 my $cmd_output = $c->get($command) if $cache; 96 if (defined $cmd_output) { 97 ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) 98 = @{$cmd_output}; 99 } else { 100 my @output = run(command => $command, verbose => 1); 101 $c->set($command, \@output) if $cache; 102 ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) 103 = @output; 104 } 105 ### end cache hook 106 107 die "Unable to perform ppStats on exposure id $exp_tag: $error_code\n" 108 if not $success; 86 109 87 110 # Parse the output
Note:
See TracChangeset
for help on using the changeset viewer.
