Changeset 30674
- Timestamp:
- Feb 17, 2011, 1:38:26 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
-
ippScripts/scripts/receive_file.pl (modified) (6 diffs)
-
ippTasks/receive.pro (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/receive_file.pl
r29973 r30674 41 41 42 42 # Parse the command-line arguments 43 my ( $file_id, $source, $product, $fileset, $fileset_id, $file, $component, $bytes, $md5sum, $workdir, $dirinfo_uri, $ dbname, $verbose, $no_update, $save_temps );43 my ( $file_id, $source, $product, $fileset, $fileset_id, $file, $component, $bytes, $md5sum, $workdir, $dirinfo_uri, $no_extract, $dbname, $verbose, $no_update, $save_temps ); 44 44 45 45 GetOptions( … … 54 54 'md5sum=s' => \$md5sum, # md5sum for file from data store 55 55 'workdir=s' => \$workdir, # Working directory for output 56 'no-extract' => \$no_extract, # Do not extract the tarfiles 56 57 'dirinfo=s' => \$dirinfo_uri, # file containing the destination directories for this component 57 58 'dbname=s' => \$dbname, # Database name … … 85 86 my $mdcParser = PS::IPP::Metadata::Config->new; 86 87 87 88 # select a directory for the dirinfo and dbinfo files 89 # XXX: perhaps this directory should be set by the script and passed in 90 # rather than computed here. 91 92 my ($day, $month, $year) = (localtime)[3,4,5]; 93 my $datestr = sprintf "%04d%02d%02d", $year+1900, $month + 1, $day; 94 my $dir_for_info_files = caturi($workdir, $datestr, $fileset); 95 96 97 my $is_tarfile = 0; 98 if ($file =~ m|.*\.tgz$|) { # XXX: perhaps get this off of file type ? 99 $is_tarfile = 1; 100 } 101 102 my $filename; 103 if ($is_tarfile and $no_extract) { 104 $filename = "$dir_for_info_files/$file"; 105 } else { 106 $filename = "$tempdir/$file"; 107 } 88 108 89 109 # Retrieve file 90 my $filename = "$tempdir/$file"; # Target filename91 110 { 92 111 my $uri = "$source/$product/$fileset/$file"; # URI for datastore file … … 107 126 my ($destdir, $components, $dirinfo_lines) = read_dirinfo_file($dirinfo_file_to_read, $file_id); 108 127 109 # select a directory for the dirinfo and dbinfo files110 # XXX: perhaps this directory should be set by the script and passed in111 # rather than computed here.112 113 my ($day, $month, $year) = (localtime)[3,4,5];114 my $datestr = sprintf "%04d%02d%02d", $year+1900, $month + 1, $day;115 my $dir_for_info_files = caturi($workdir, $datestr, $fileset);116 128 117 129 # Deal with file … … 279 291 280 292 281 } elsif ($ file =~ m|.*\.tgz$|) { # XXX: perhaps get this off of file type ?293 } elsif ($is_tarfile and !$no_extract) { 282 294 # Get contents of tarball 283 295 my @files = (); … … 339 351 } 340 352 } 353 } elsif ($is_tarfile and $no_extract) { 354 print "skipping extraction of tarfile $filename\n"; 341 355 } else { 342 356 &my_die( "Unrecognised file: $file\n", $file_id, $PS_EXIT_UNKNOWN_ERROR); -
trunk/ippTasks/receive.pro
r24749 r30674 105 105 $receive_Advance_DB = 0 106 106 107 # set this to skip extraction of tarfiles into their destination directories 108 $NO_EXTRACT = "" 109 macro set.no.extract 110 $NO_EXTRACT = "--no-extract" 111 end 112 macro clear.no.extract 113 $NO_EXTRACT = "" 114 end 115 macro show.no.extract 116 echo $NO_EXTRACT 117 end 118 107 119 task receive.source.load 108 120 host local … … 416 428 host anyhost 417 429 418 $run = receive_file.pl --file_id $FILE_ID --source $SOURCE --product $PRODUCT --fileset $FILESET --fileset_id $FILESET_ID --file $FILE --component $COMPONENT --bytes $BYTES --md5 $MD5SUM --workdir $WORKDIR --dirinfo $DIRINFO 430 $run = receive_file.pl --file_id $FILE_ID --source $SOURCE --product $PRODUCT --fileset $FILESET --fileset_id $FILESET_ID --file $FILE --component $COMPONENT --bytes $BYTES --md5 $MD5SUM --workdir $WORKDIR --dirinfo $DIRINFO $NO_EXTRACT 419 431 add_standard_args run 420 432
Note:
See TracChangeset
for help on using the changeset viewer.
