Changeset 18247
- Timestamp:
- Jun 20, 2008, 3:08:02 PM (18 years ago)
- Location:
- trunk/pstamp
- Files:
-
- 6 edited
-
scripts/pstamp_listjobs.pl (modified) (4 diffs)
-
scripts/pstamp_queue_requests.pl (modified) (1 diff)
-
scripts/pstamp_webrequest.pl (modified) (2 diffs)
-
src/pstampfinish.c (modified) (3 diffs)
-
src/pstampparse.c (modified) (2 diffs)
-
web/request.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pstamp/scripts/pstamp_listjobs.pl
r18236 r18247 8 8 use warnings; 9 9 use strict; 10 use Getopt::Long qw( GetOptions ); 11 12 my $verbose; 13 my $dbname; 14 15 GetOptions( 16 'verbose' => \$verbose, 17 'dbname=s' => \$dbname, 18 ); 10 19 11 20 if (@ARGV != 1) { … … 15 24 my $request_id = $ARGV[0]; 16 25 17 my $verbosity = 0;18 26 19 27 use Sys::Hostname; … … 21 29 22 30 ## This isn't a script to be launched by pantasks we probably want go get rid of this 23 if ($verbos ity) {31 if ($verbose) { 24 32 print STDERR "\n\n"; 25 33 print STDERR "Starting script $0 on $host\n\n"; … … 59 67 { 60 68 my $command = "$pstamptool -listjob -req_id $request_id"; 69 $command .= " -dbname $dbname" if $dbname; 61 70 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 62 run(command => $command, verbose => $verbos ity);71 run(command => $command, verbose => $verbose); 63 72 unless ($success) { 64 73 die("Unable to perform pstamptool -pendingreq: $error_code"); -
trunk/pstamp/scripts/pstamp_queue_requests.pl
r18234 r18247 17 17 my $verbose; 18 18 my $dbname; 19 my $limit; 19 20 20 21 GetOptions( 21 22 'verbose' => \$verbose, 22 23 'dbname=s' => \$dbname, 24 'limit=s' => \$limit, 23 25 ); 24 26 -
trunk/pstamp/scripts/pstamp_webrequest.pl
r18233 r18247 68 68 # if -list is used, it must be the first argument 69 69 my $listMode; 70 if ($ARGV[0] eq "-list " ) {70 if ($ARGV[0] eq "-list_uri" ) { 71 71 $listMode=1; 72 72 } else { … … 92 92 ### In list mode just parse the file print the output and we're done 93 93 ### 94 my $command = "$pstampparse $request_file"; 94 ### XXX TODO: I shouldn't need this -mode list_uri since it's in the request file 95 my $command = "$pstampparse -mode list_uri $request_file"; 95 96 $command .= " -dbname $dbname" if $dbname; 96 97 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = -
trunk/pstamp/src/pstampfinish.c
r18243 r18247 26 26 psString dsRoot; 27 27 psString dsProduct; 28 psString dbName; 28 29 int exitStatus; 29 30 } psrfOptions; … … 70 71 return NULL; 71 72 } 73 psBool status; 74 options->dbName = psMetadataLookupStr(&status, options->config->complete, "DBNAME"); 72 75 73 76 if ((argnum = psArgumentGet(argc, argv, "-mode"))) { … … 265 268 psString command = NULL; 266 269 267 psStringAppend(&command, "dsreg --add --type PSRESULTS --product %s --fileset %s", 268 options->dsProduct, fileset_id); 269 270 printf("command is: %s\n", command); 270 psStringAppend(&command, "dsreg --dbname %s --add --type PSRESULTS --product %s --fileset %s", 271 options->dbName, options->dsProduct, fileset_id); 272 273 if (options->verbose) { 274 fprintf(stderr, "command is: %s\n", command); 275 } 271 276 272 277 // open a pipe to dsreg and set up the output fileset -
trunk/pstamp/src/pstampparse.c
r18243 r18247 64 64 } 65 65 66 // XXX: need to sort out the interactions of this mode option and the JOB_TYPE 67 // listed in the request file. 66 68 if ((argnum = psArgumentGet(argc, argv, "-mode"))) { 67 69 psArgumentRemove(argnum, &argc, argv); … … 629 631 psStringAppend(&cmd, " -args '%s'", commandArgs); 630 632 } 633 // XXX We may want to have the data store name be different than the default DB 634 psBool status; 635 psString dbName = psMetadataLookupStr(&status, options->config->complete, "DBNAME"); 636 fprintf(stderr, "\n\n dbName is %s\n", dbName); 637 if (dbName) { 638 psStringAppend(&cmd, " -dbname %s", dbName); 639 } 640 631 641 psStringAppend(&cmd, " > /dev/null"); 632 642 -
trunk/pstamp/web/request.php
r18238 r18247 1 1 <?php 2 2 3 // prototype postage stamp server web interface 4 3 5 // A php program that generates a postage stamp request form 4 6 5 // There are two modes on the form List Images simply lists the input images that match6 // th e image selection critera7 // There are two modes on the form List Images simply lists the input images 8 // that match the image selection critera 7 9 8 10 // When make stamps is selected when the page is posted, a postage stamp request is queued. … … 12 14 // The mode for the page is given by $request_id != 0 13 15 14 $COMMAND_DIR = "/export/data0/bills/src/ipp/pstamp/scripts"; 16 // XXX This is just a prototype for testing purposes. 17 18 19 // BEGIN Local configuration 20 21 $COMMAND_DIR = "/export/data0/bills/psconfig/debug.linrh64/bin"; 15 22 $dsroot = "/export/data1/datastore/dsroot"; 23 $dbname = "simtest"; 24 25 // END Local configuration 26 // (actually there is a little bit more in $COMMAND_DIR/pstamp_runcommand.sh ) 16 27 17 28 // Initialize variables … … 213 224 global $rvar_id, $rvar_class_id; 214 225 global $command_line; 215 226 global $dbname; 227 228 $making_stamps = 1; 216 229 $cmd = "pstamp_runcommand.sh pstamp_webrequest.pl"; 217 230 218 $making_stamps = 1;231 // NOTE: If it is used, -list_uri must be the first argument to pstamp_webrequest.pl 219 232 220 233 if ($list_checked) { 221 $cmd .= " -list ";234 $cmd .= " -list_uri"; 222 235 $making_stamps = 0; 223 236 } else if ($get_checked) { 224 237 $making_stamps = 0; 225 238 $cmd .= " -get_image"; 239 } 240 241 if ($dbname) { 242 $cmd .= " --dbname $dbname"; 226 243 } 227 244 … … 291 308 292 309 if (($rvar_img_type == "raw") || ($rvar_img_type == "chip")) { 293 if (! $rvar_class_id ) {294 throw new Exception("must specify Class ID with Image Type $rvar_img_type.");295 }296 if ( $rvar_class_id = "all") {310 # if (! $rvar_class_id ) { 311 # throw new Exception("must specify Class ID with Image Type $rvar_img_type."); 312 # } 313 if ((!$rvar_class_id) || ($rvar_class_id = "all")) { 297 314 $cmd .= " null"; 298 315 } else { … … 402 419 403 420 $command_line = "pstamp_runcommand.sh pstamp_listjobs.pl $request_id"; 421 global $dbname; 422 if ($dbname) { 423 $command_line .= " --dbname $dbname"; 424 } 425 404 426 run_command($command_line); 405 427 if ($jobFinished) { … … 429 451 global $output_array; 430 452 global $outFileset; 453 global $dbname; 431 454 432 455 $command_line = "pstamp_runcommand.sh pstamptool -listreq -req_id $request_id -simple"; 456 if ($dbname) { 457 $command_line .= " -dbname $dbname"; 458 } 433 459 run_command($command_line); 434 460 if ($command_status == 0) {
Note:
See TracChangeset
for help on using the changeset viewer.
