Changeset 24038 for trunk/ippScripts/scripts/receive_file.pl
- Timestamp:
- May 1, 2009, 5:28:52 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/ippScripts/scripts/receive_file.pl (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/receive_file.pl
r23895 r24038 36 36 37 37 # Parse the command-line arguments 38 my ( $file_id, $source, $product, $fileset, $file , $workdir, $dbname, $verbose, $no_update, $save_temps );38 my ( $file_id, $source, $product, $fileset, $fileset_id, $file, $workdir, $dbname, $verbose, $no_update, $save_temps ); 39 39 40 40 GetOptions( … … 43 43 'product=s' => \$product, # Product for data 44 44 'fileset=s' => \$fileset, # Fileset for data 45 'fileset_id=s' => \$fileset_id, # database id for the fileset 45 46 'file=s' => \$file, # File to retrieve 46 47 'workdir=s' => \$workdir, # Working directory for output … … 61 62 defined $workdir; 62 63 64 $tempdir .= "/$file_id"; 65 63 66 my $ipprc = PS::IPP::Config->new() or 64 67 &my_die( "Unable to set up", $file_id, $PS_EXIT_CONFIG_ERROR ); # IPP configuration … … 80 83 # Load into database 81 84 85 my $target = "$workdir/$file"; # Target destination for file 86 my $fixName = $ipprc->file_create( $target ); # Target for move 87 my $fixFile; 88 89 open $fixFile, ">$fixName" or die "can't open $fixName\n"; 90 82 91 # Need to fix paths to point to new workdir 83 my ($fixFile, $fixName) = tempfile( "$tempdir/$file.XXXX", UNLINK => !$save_temps ); # Fixed file84 92 open my $inFile, $filename or die "Can't open $filename\n"; # Input file 85 93 my $workdir_old; # Old workdir … … 98 106 } 99 107 close($inFile); 100 101 my ($stage) = $file =~ m|^dbinfo\.(\S+)\.\d+\.mdc$|; # Stage of interest 102 my $tool = can_run("${stage}tool") or die "Can't find tool to load $file\n"; 103 104 my $command = "$tool -importrun -infile $fixName"; # Command to execute 108 close($fixFile); 109 #{ 110 my $command = "$receivetool -updatefileset -fileset_id $fileset_id -dbinfo_uri $fixName"; # Command to execute 105 111 $command .= " -dbname $dbname" if defined $dbname; 106 112 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 107 113 run(command => $command, verbose => $verbose); 108 die "Unable to load $fixName\n" unless $success; 114 die "Unable to set dbinfo_uri for $fileset_id to $fixName\n" unless $success; 115 #} 116 109 117 } elsif ($file =~ m|.*\.tgz$|) { 110 118 # Get contents of tarball
Note:
See TracChangeset
for help on using the changeset viewer.
