- Timestamp:
- May 3, 2010, 8:50:52 AM (16 years ago)
- Location:
- branches/simtest_nebulous_branches
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
ippScripts/scripts/register_imfile.pl (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/simtest_nebulous_branches
- Property svn:mergeinfo changed
-
branches/simtest_nebulous_branches/ippScripts/scripts/register_imfile.pl
r23831 r27840 8 8 use Sys::Hostname; 9 9 my $host = hostname(); 10 my $date = `date`; 10 11 print "\n\n"; 11 print "Starting script $0 on $host \n\n";12 print "Starting script $0 on $host at $date\n\n"; 12 13 13 14 use vars qw( $VERSION ); … … 33 34 my $ppStats = can_run( 'ppStats' ) or (warn "Can't find ppStats" and $missing_tools = 1); 34 35 my $ppStatsFromMetadata = can_run( 'ppStatsFromMetadata' ) or (warn "Can't find ppStatsFromMetadata" and $missing_tools = 1); 35 36 my ($cache, $exp_id, $tmp_class_id, $tmp_exp_name, $uri, $dbname, $verbose, $no_update, $no_op, $logfile); 36 my $ppConfigDump = can_run( 'ppConfigDump' ) or (warn "Can't find ppConfigDump" and $missing_tools = 1); 37 38 my ($cache, $exp_id, $tmp_class_id, $tmp_exp_name, $uri, $bytes, $md5sum, $dbname, $verbose, $no_update, $no_op, $logfile); 37 39 GetOptions( 38 40 'caches' => \$cache, … … 41 43 'tmp_exp_name|n=s' => \$tmp_exp_name, 42 44 'uri|u=s' => \$uri, 45 'bytes=s' => \$bytes, 46 'md5sum=s' => \$md5sum, 43 47 'dbname|d=s' => \$dbname, # Database name 44 48 'verbose' => \$verbose, # Print to stdout … … 106 110 chomp $out2; 107 111 $cmdflags = $out2; 112 113 # Manually parse the burntool_state entry. 114 my $burntoolState = 0; 115 my $isGPC1 = 0; 116 my $burntoolStateGood = 0; 117 foreach my $line (split /\n/, $out1) { 118 if ($line =~ /FPA.BURNTOOL.APPLIED/) { 119 $line =~ s/^\s+//; 120 $burntoolState = (split /\s+/, $line)[2]; 121 } 122 if ($line =~ /FPA.CAMERA/) { 123 $line =~ s/^\s+//; 124 if ((split /\s+/, $line)[2] eq 'GPC1') { 125 $isGPC1 = 1; 126 } 127 } 128 } 129 if ($isGPC1 != 1) { 130 $burntoolState = 0; # If it's not GPC1, you shouldn't have run burntool. 131 } 132 elsif (($isGPC1 == 1) && ($burntoolState == 1)) { 133 # print STDERR "In the good region: >>$burntoolState<<\n"; 134 my $ppConfigDump_cmd = "$ppConfigDump -camera GPC1 -dump-camera -"; 135 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 136 IPC::Cmd::run(command => $ppConfigDump_cmd, verbose => $verbose); 137 unless ($success) { 138 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 139 warn ("Unable to perform ppConfigDump"); 140 exit($error_code); 141 } 142 143 # This is ugly, but doing a full parse for one entry is a bit wasteful. 144 foreach my $line (split /\n/, (join "", @$stdout_buf)) { 145 if ($line =~ /BURNTOOL.STATE.GOOD/) { 146 $line =~ s/^\s+//; 147 $burntoolStateGood = (split /\s+/, $line)[2]; 148 last; 149 } 150 } 151 $burntoolState = $burntoolStateGood; # Positive because this has the header table. 152 153 } 154 $cmdflags .= " -burntool_state $burntoolState "; 108 155 } 109 156 … … 123 170 $command .= " -tmp_class_id $tmp_class_id"; # the original class_id supplied by the user, replace by ppStats CLASS.ID 124 171 $command .= " -uri $uri "; 172 $command .= " -bytes $bytes" if $bytes; 173 $command .= " -md5sum $md5sum" if $md5sum and ($md5sum ne 'NULL'); 125 174 $command .= " -hostname $host" if defined $host; 126 175 $command .= " -dbname $dbname" if defined $dbname;
Note:
See TracChangeset
for help on using the changeset viewer.
