Changeset 35363
- Timestamp:
- Apr 4, 2013, 11:39:06 AM (13 years ago)
- File:
-
- 1 edited
-
trunk/pstamp/scripts/pstampparse.pl (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pstamp/scripts/pstampparse.pl
r34447 r35363 93 93 my $fields_output; 94 94 { 95 my $command = "echo $request_file_name | $fields -x 0 EXTNAME EXTVER REQ_NAME ACTION USEREMAIL";95 my $command = "echo $request_file_name | $fields -x 0 EXTNAME EXTVER REQ_NAME ACTION EMAIL"; 96 96 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 97 97 run(command => $command, verbose => $verbose); … … 102 102 $fields_output = join "", @$stdout_buf; 103 103 } 104 my (undef, $extname, $extver, $req_name, $action, $ username, $email) = split " ", $fields_output;104 my (undef, $extname, $extver, $req_name, $action, $email) = split " ", $fields_output; 105 105 106 106 # make sure the file contains what we are expecting 107 107 # This program shouldn't have been run if the request file is bogus. 108 # No need to notify the client109 108 my_die("$request_file_name is not a PS1_PS_REQEST", $PS_EXIT_PROG_ERROR) if $extname ne "PS1_PS_REQUEST"; 110 109 my_die("REQ_NAME not found in $request_file_name", $PS_EXIT_PROG_ERROR) if (!$req_name); 111 110 my_die("wrong EXTVER $extver found in $request_file_name", $PS_EXIT_PROG_ERROR) if ($extver ne "1" and $extver ne "2"); 112 111 112 if ($extver >= 2) { 113 # We have a version 2 file. Require that the new keywords be supplied. 114 my_die("action not supplied in version $extver request file $request_file_name", $PSTAMP_INVALID_REQUEST) unless defined $action; 115 116 my_die("invalid action: $action supplied in version $extver request file $request_file_name", $PSTAMP_INVALID_REQUEST) unless (uc($action) eq 'PROCESS' or uc($action) eq 'PREVIEW'); 117 118 my_die("email not supplied in version $extver request file $request_file_name", $PSTAMP_INVALID_REQUEST) unless $email; 119 # XXX check for "valid" $email 120 } else { 121 # for version 1 file the action is process and email is not used 122 $action = 'PROCESS'; 123 $email = 'null'; 124 } 125 126 print "Request Header Keywords EXTVER: $extver REQ_NAME: $req_name ACTION: $action EMAIL: $email\n"; 113 127 114 128 # check for duplicate request name … … 161 175 # the output data store's product name 162 176 my $command = "$pstamptool -updatereq -req_id $req_id -set_name $req_name"; 177 $command .= " -set_username $email" if $email ne 'null'; 163 178 $command .= " -set_outProduct $product"; 164 179 $command .= " -set_label $label" if $label_changed; … … 362 377 return 0; 363 378 } 364 365 # $mode list_uri is a debugging mode (it may used by the http interface)366 # if this happens just croak367 # my_die("job_type is list_uri but mode is $mode", $PS_EXIT_PROG_ERROR) if ($job_type eq "list_uri") and ($mode ne "list_uri");368 369 379 370 380 if ($req_type eq "bycoord") {
Note:
See TracChangeset
for help on using the changeset viewer.
