Changeset 9475 for trunk/ippScripts/scripts/phase0_imfile.pl
- Timestamp:
- Oct 10, 2006, 2:12:25 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
r9468 r9475 11 11 use PS::IPP::Metadata::Stats; 12 12 use Data::Dumper; 13 use Cache::File;14 13 15 14 use PS::IPP::Config; … … 20 19 use Pod::Usage qw( pod2usage ); 21 20 22 my ($ cache, $exp_tag, $class_id, $uri, $no_update);21 my ($exp_tag, $class_id, $uri, $no_update); 23 22 24 23 GetOptions( 25 'caches' => \$cache, 26 'exp_tag|e=s' => \$exp_tag, 24 'exp_tag|e=s' => \$exp_tag, 27 25 'class_id|i=s' => \$class_id, 28 26 'uri|u=s' => \$uri, … … 76 74 die "Can't find required tools.\n" if $missing_tools; 77 75 78 # setup cache interface79 80 my $c = Cache::File->new(81 cache_root => File::Spec->catdir($ENV{'HOME'}, '.pxcache'),82 default_expires => '7200 sec',83 );84 85 76 # Resolve the input URI 86 77 $uri = File::Spec->rel2abs( $uri, $ipprc->workdir() ); … … 90 81 { 91 82 my $command = "$ppStats $uri -recipe PPSTATS " . RECIPE; # Command to run ppStats 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; 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; 109 86 110 87 # Parse the output
Note:
See TracChangeset
for help on using the changeset viewer.
