Changeset 28181 for trunk/ippScripts/scripts/minidvodb_merge.pl
- Timestamp:
- Jun 1, 2010, 3:09:47 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 1 edited
- 1 copied
-
. (modified) (1 prop)
-
ippScripts/scripts/minidvodb_merge.pl (copied) (copied from branches/haf_branches/ipp.20100512/ippScripts/scripts/minidvodb_merge.pl ) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/haf_branches/ipp.20100512 (added) merged: 27935-27937,27956,28034-28037,28058-28061,28101-28102,28104,28168-28171,28177,28180
- Property svn:mergeinfo changed
-
trunk/ippScripts/scripts/minidvodb_merge.pl
r28180 r28181 87 87 unless ($no_op) { 88 88 if (defined $mergedvodbReal) { 89 {89 { 90 90 my $command = "$addstar -resort"; 91 91 $command .= " -D CAMERA $camera"; … … 101 101 } 102 102 $dtime_addstar = 86400.0*(DateTime->now->mjd - $mjd_addstar_start); $dtime_resort = $dtime_addstar; 103 # MJD of starting script103 # MJD of starting script 104 104 print "addstar -resort time $dtime_addstar\n"; 105 105 } … … 123 123 print "relphot time $dtime_relphot\n"; 124 124 } 125 126 { 127 128 my $mdcParser = PS::IPP::Metadata::Config->new; 129 130 131 my $command = "$addtool -listminidvodbrun -state mergedsdfsad -minidvodb_group " . $minidvodb_group; 132 $command .= " -dbname $dbname" if defined $dbname; 133 134 135 136 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 125 126 my $this_is_the_first; 127 { 128 129 my $mdcParser = PS::IPP::Metadata::Config->new; 130 131 my $command = "$addtool -listminidvodbrun -state mergedsdfsad -minidvodb_group " . $minidvodb_group; 132 $command .= " -dbname $dbname" if defined $dbname; 133 134 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 137 135 run(command => $command, verbose => $verbose); 138 &my_die( "Unable to get list of minidvodbruns", $minidvodb_id, $PS_EXIT_SYS_ERROR) unless $success; 139 my $this_is_the_first; 140 if (scalar @$stdout_buf == 0 ) { #it lists nothing if it is the first 141 $this_is_the_first =1; 142 } else { 143 my $metadata = $mdcParser->parse(join "", @$stdout_buf) or 136 &my_die( "Unable to get list of minidvodbruns", $minidvodb_id, $PS_EXIT_SYS_ERROR) unless $success; 137 if (scalar @$stdout_buf == 0 ) { #it lists nothing if it is the first 138 $this_is_the_first =1; 139 } else { 140 my $metadata = $mdcParser->parse(join "", @$stdout_buf) or 144 141 &my_die("Unable to parse metadata config", $minidvodb_id, $PS_EXIT_PROG_ERROR); 145 #this fails if there is nothing listed. I checked.142 #this fails if there is nothing listed. I checked. 146 143 my $components = parse_md_list($metadata) or 147 144 &my_die("Unable to parse metadata list", $minidvodb_id, $PS_EXIT_PROG_ERROR); 148 145 my $comp = $$components[0]; 149 my $minidvodb_name = $comp->{minidvodb_name};150 146 my $minidvodb_name = $comp->{minidvodb_name}; 147 151 148 if (!defined($minidvodb_name)) { 152 149 &my_die("Unable to parse minidvodb_name", $minidvodb_id, $PS_EXIT_PROG_ERROR); 153 150 } #but just to make sure, have it grab a minidvodb_name, to make sure it's not junk. 154 $this_is_the_first = 0; 155 } 156 157 my $merge_command; 158 if ($this_is_the_first) { 159 160 $merge_command = "cp -rp $minidvodb $mergedvodb" 161 162 } else { 163 164 $merge_command = "$dvomerge $minidvodb into $mergedvodb" 165 } 166 167 168 169 system ($merge_command); 170 171 my ( $success2, $error_code2, $full_buf2, $stdout_buf2, $stderr_buf2 ) = 172 run(command => $merge_command, verbose => $verbose); 173 unless ($success2) { 174 $error_code2 = (($error_code2 >> 8) or $PS_EXIT_PROG_ERROR); 175 &my_die("Unable to merge: $error_code", $mergedvodb, $error_code2); 176 } 177 178 179 $dtime_merge = 86400.0*(DateTime->now->mjd - $mjd_relphot_start); # MJD of starting script 151 $this_is_the_first = 0; 152 } 153 } 154 155 { 156 my $merge_command; 157 if ($this_is_the_first) { 158 $merge_command = "cp -rp $minidvodb $mergedvodb" 159 } else { 160 $merge_command = "$dvomerge $minidvodb into $mergedvodb" 161 } 162 163 my $mjd_merge_start = DateTime->now->mjd; # MJD of starting script 164 165 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 166 run(command => $merge_command, verbose => $verbose); 167 unless ($success) { 168 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 169 &my_die("Unable to merge: $error_code", $mergedvodb, $error_code); 170 } 171 172 $dtime_merge = 86400.0*(DateTime->now->mjd - $mjd_merge_start); # MJD of starting script 180 173 print "merge time $dtime_merge\n"; 181 182 } 183 184 185 { 186 my $command = "addtool -minidvodb_id $minidvodb_id"; 187 $command .= " -addminidvodbprocessed"; 188 $command .= " -mergedvodb_path $mergedvodbReal" if defined $mergedvodbReal; 189 $command .= " -minidvodb_group $minidvodb_group"; 190 $command .= " -dtime_relphot $dtime_relphot" if defined $dtime_relphot; 191 $command .= " -dtime_relphot $dtime_resort" if defined $dtime_resort; 192 $command .= " -dtime_relphot $dtime_merge" if defined $dtime_merge; 193 $command .= " -dbname $dbname" if defined $dbname; 194 #print $command; 195 system ($command); 196 197 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 198 run(command => $command, verbose => $verbose); 199 unless ($success) { 200 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 201 &my_die("Unable to add to minidvodbprocessed: $error_code", $mergedvodb, $error_code); 202 } 203 204 } 174 } 175 176 177 { 178 my $command = "addtool -minidvodb_id $minidvodb_id"; 179 $command .= " -addminidvodbprocessed"; 180 $command .= " -mergedvodb_path $mergedvodbReal" if defined $mergedvodbReal; 181 $command .= " -minidvodb_group $minidvodb_group"; 182 $command .= " -dtime_relphot $dtime_relphot" if defined $dtime_relphot; 183 $command .= " -dtime_relphot $dtime_resort" if defined $dtime_resort; 184 $command .= " -dtime_relphot $dtime_merge" if defined $dtime_merge; 185 $command .= " -dbname $dbname" if defined $dbname; 186 #print $command; 187 188 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 189 run(command => $command, verbose => $verbose); 190 unless ($success) { 191 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 192 &my_die("Unable to add to minidvodbprocessed: $error_code", $mergedvodb, $error_code); 193 } 194 } 205 195 206 196 } else { … … 217 207 { 218 208 my $msg = shift; # Warning message on die 219 my $minidbvodb_id = shift; 209 my $minidbvodb_id = shift; 220 210 my $exit_code = shift; # Exit code to add 221 211 … … 223 213 224 214 if (defined $minidvodb_id ) { 225 215 226 216 my $command = "addtool -minidvodb_id $minidvodb_id"; 227 217 $command .= " -addminidvodbprocessed"; 228 218 $command .= " -fault $exit_code"; 229 $command .= " -mergedvodb_path $mergedvodbReal" if defined $mergedvodbReal;230 $command .= " -minidvodb_group $minidvodb_group";219 $command .= " -mergedvodb_path $mergedvodbReal" if defined $mergedvodbReal; 220 $command .= " -minidvodb_group $minidvodb_group"; 231 221 $command .= " -dtime_relphot $dtime_relphot" if defined $dtime_relphot; 232 222 $command .= " -dtime_relphot $dtime_resort" if defined $dtime_resort; 233 223 $command .= " -dtime_relphot $dtime_merge" if defined $dtime_merge; 234 224 $command .= " -dbname $dbname" if defined $dbname; 235 236 225 226 237 227 238 228 #print $command;
Note:
See TracChangeset
for help on using the changeset viewer.
