IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 16, 2009, 5:54:55 PM (17 years ago)
Author:
Paul Price
Message:

Distribution client workflow is now working!

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippScripts/scripts/receive_file.pl

    r23890 r23894  
    6565my $filename = "$tempdir/$file";  # Target filename
    6666{
    67     my $uri = "$source/product/$fileset/$file"; # URI for datastore file
     67    my $uri = "$source/$product/$fileset/$file"; # URI for datastore file
    6868    my $command = "dsget --uri $uri --filename $filename"; # Command to execute
    6969
     
    8181
    8282    my $command = "$tool -importrun -infile $filename"; # Command to execute
     83    $command .= " -dbname $dbname" if defined $dbname;
    8384    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    8485        run(command => $command, verbose => $verbose);
     
    8889    my @files = ();
    8990    {
    90         my $command = "tar -C $tempdir -tvzf $filename"; # Command to execute
     91        my $command = "tar -C $tempdir -tzf $filename"; # Command to execute
    9192        my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    9293            run(command => $command, verbose => $verbose);
    9394        die "Unable to get listing of tar file $filename\n" unless $success;
    9495
    95         foreach my $line (@$stdout_buf) {
     96        my @lines = split(/\n/, join "", @$stdout_buf); # Lines from output
     97        foreach my $line ( @lines ) {
    9698            $line =~ s/\#.*$//;
    9799            next unless $line =~ /\S+/;
     
    99101            my $file = $fields[0];      # Name of file
    100102            $file =~ s|^./||;
    101             push @files, $file if defined $file;
     103            push @files, $file if $file =~ /\S+/;
    102104        }
    103105    }
     
    115117        my $from = "$tempdir/$file"; # Source for file
    116118        my $target = "$workdir/$file"; # Target destination for file
    117         my $to = $ipprc->file_prepare( $target ); # Target for move
     119        my $to = $ipprc->file_create( $target ); # Target for move
    118120        system("mv $from $to") == 0 or die "Unable to move $file into workdir $workdir: $!\n";
    119121    }
     
    129131{
    130132    my $command = "$receivetool -addresult";
    131     $command .= " -file $file_id";
     133    $command .= " -file_id $file_id";
    132134    $command .= (" -dtime_copy " . (($mjd_copy - $mjd_start) * 86400));
    133     $command .= (" -dtime_extract " . (($mjd_extract - $mjd_start) * 86400));
     135    $command .= (" -dtime_extract " . (($mjd_extract - $mjd_copy) * 86400));
    134136    $command .= " -dbname $dbname" if defined $dbname;
     137
     138
     139    print "$command\n";
    135140
    136141    unless (defined $no_update) {
Note: See TracChangeset for help on using the changeset viewer.