Changeset 17928 for trunk/ippScripts/scripts
- Timestamp:
- Jun 4, 2008, 4:48:11 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/ippScripts/scripts/ipp_image_path.pl (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/ipp_image_path.pl
r17862 r17928 19 19 use Pod::Usage qw( pod2usage ); 20 20 21 my ($exp_name, $class_id, $ dbname, $verbose);21 my ($exp_name, $class_id, $from_registered, $dbname, $verbose); 22 22 23 23 GetOptions( 24 24 'exp_name|e=s' => \$exp_name, 25 25 'class_id|c=s' => \$class_id, 26 'registered|r' => \$from_registered, 26 27 'dbname|d=s' => \$dbname, # Database name 27 28 'verbose' => \$verbose, # Print to stdout … … 33 34 defined $exp_name; 34 35 36 my $ota_num; 35 37 if ($class_id) { 36 38 $class_id = lc($class_id); 39 my $extra; 40 (undef, $ota_num, $extra) = $class_id =~ m/(\D*)(\d\d)(.*)/; 41 if ($extra || !$ota_num) { 42 print STDERR "$class_id is not a valid class_id\n"; 43 exit 1; 44 } 37 45 } 38 46 … … 54 62 # XXX: If there are multiple exposures with the same exposure name 55 63 # this query will return them all 56 my $query = "SELECT exp_id, class_id, uri FROM rawImfile" 64 my $query; 65 if ($from_registered) { 66 $query = "SELECT exp_id, class_id, uri FROM rawImfile" 57 67 . " WHERE exp_name = \'$exp_name\'"; 58 if ($class_id) { 59 $query .= " AND class_id = \'$class_id\'"; 68 $query .= " AND class_id = \'xy$ota_num\'" if ($ota_num); 69 } else { 70 $query = "SELECT exp_id FROM newExp WHERE tmp_exp_name = ?"; 71 my $stmt = $dbh->prepare($query); 72 $stmt->execute($exp_name); 73 my $exp_ref = $stmt->fetchrow_hashref(); 74 if (!$exp_ref) { 75 print STDERR "exposure $exp_name not found\n"; 76 exit 1; 77 } 78 $stmt->finish(); 79 $query = "SELECT exp_id, tmp_class_id, uri FROM newImfile WHERE exp_id = $exp_ref->{exp_id}"; 80 $query .= " AND tmp_class_id = \'ota$ota_num\'" if ($ota_num); 60 81 } 61 82
Note:
See TracChangeset
for help on using the changeset viewer.
