IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 8, 2011, 2:44:12 PM (15 years ago)
Author:
eugene
Message:

merge changes from trunk

Location:
branches/eam_branches/ipp-20110906
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20110906

  • branches/eam_branches/ipp-20110906/ippScripts/scripts/lap_science.pl

    r32195 r32630  
    2727my ( $camera, $dbname);
    2828my ( $lap_id );
     29my ( $queue_list );
    2930my ( $chip_mode, $monitor_mode, $cleanup_mode);
    3031
     
    4445   
    4546    'lap_id=s'     => \$lap_id,
     47    'queue_list=s' => \$queue_list,
    4648
    4749    'chip_mode'    => \$chip_mode,
     
    200202    return($exposure);
    201203}
     204
     205sub remake_this_exposure_by_update {
     206    my $exposure = shift;
     207
     208    my @utctime = gmtime();
     209    $utctime[5] += 1900;
     210    $utctime[4] += 1;
     211
     212    my $label = $exposure->{label};
     213
     214    my $date = sprintf("%4d%02d%02d",$utctime[5],$utctime[4],$utctime[3]);
     215    my $workdir_date = sprintf("%4d/%02d/%02d",$utctime[5],$utctime[4],$utctime[3]);
     216    my $workdir = "neb://\@HOST\@.0/${dbname}/${label}/${workdir_date}";
     217    my $data_group = "${label}.${date}";
     218
     219    my $chiptool_info_cmd = "chiptool -listrun -exp_id $exposure->{exp_id} -chip_id $exposure->{chip_id} ";
     220    $chiptool_info_cmd   .= " -dbname $dbname " if defined $dbname;
     221
     222    my ($success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     223        run(command => $chiptool_info_cmd, verbose => $verbose);
     224    unless ($success) {
     225        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     226        &my_die("Unable to perform chiptool -listrun: $error_code", $exposure->{exp_id}, $data_group);
     227    }
     228    my $chips = $mdcParser->parse_list(join "", @$stdout_buf) or
     229        &my_die("Unable to parse metadata from chiptool -listrun", $exposure->{exp_id}, $data_group);
     230    # There should be only one.
     231    my $chip = ${ $chips }[0];
     232    my $chip_magicDS_id = 0;
     233    if ($chip) {
     234        $chip_magicDS_id = $chip->{magic_ds_id};
     235    }
     236    if ($chip_magicDS_id == 0) {
     237#       return(&remake_this_exposure($exposure));
     238    }
     239
     240    my $warptool_info_cmd = "warptool -listrun -exp_id $exposure->{exp_id} -chip_id $exposure->{chip_id} ";
     241    $warptool_info_cmd   .= " -dbname $dbname " if defined $dbname;
     242    ($success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     243        run(command => $warptool_info_cmd, verbose => $verbose);
     244    unless ($success) {
     245        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     246        &my_die("Unable to perform warptool -listrun: $error_code", $exposure->{exp_id}, $data_group);
     247    }
     248    my $warps = $mdcParser->parse_list(join "", @$stdout_buf) or
     249        &my_die("Unable to parse metadata from warptool -listrun", $exposure->{exp_id}, $data_group);
     250    # There should be only one.
     251    my $warp = ${ $warps }[0];
     252    my $warp_id = 0;
     253    if ($warp) {
     254        $warp_id = $warp->{warp_id};
     255    }
     256    else {
     257        $exposure->{data_state} = 'drop';
     258        return($exposure);
     259    }   
     260    if ($warp_id == 0) {
     261        # Handle this correctly. Probably want to drop the exposure here.
     262        $exposure->{data_state} = 'drop';
     263        return($exposure);
     264    }
     265
     266    if (($chip->{state} eq 'goto_cleaned')||
     267        ($warp->{state} eq 'goto_cleaned')||
     268        ($chip->{dsRun_state} eq 'goto_cleaned')) {
     269        $exposure->{data_state} = 'pending_update';
     270        &update_this_exposure($exposure);
     271        return($exposure);
     272    }
     273
     274   
     275    my $chiptool_update_cmd = "chiptool -setimfiletoupdate -chip_id $exposure->{chip_id} -set_label $label";
     276    $chiptool_update_cmd   .= " -dbname $dbname " if defined $dbname;
     277    my $magicDS_update_cmd  = "magicdstool -setfiletoupdate -magic_ds_id $chip_magicDS_id -set_label $label";
     278    $magicDS_update_cmd    .= " -dbname $dbname " if defined $dbname;
     279    my $warptool_update_cmd = "warptool -setskyfiletoupdate -warp_id $warp_id -set_label $label";
     280    $warptool_update_cmd   .= " -dbname $dbname " if defined $dbname;
     281
     282    ($success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     283        run(command => $chiptool_update_cmd, verbose => $verbose);
     284    unless ($success) {
     285        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     286        &my_die("Unable to perform chiptool -setimfiletoupdate: $error_code", $exposure->{exp_id}, $data_group);
     287    }
     288    if ($chip_magicDS_id != 0) {   
     289        ($success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     290            run(command => $magicDS_update_cmd, verbose => $verbose);
     291        unless ($success) {
     292            $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     293            &my_die("Unable to perform magicdstool -setfiletoupdate: $error_code", $exposure->{exp_id}, $data_group);
     294        }
     295    }
     296
     297    ($success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     298        run(command => $warptool_update_cmd, verbose => $verbose);
     299    unless ($success) {
     300        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     301        &my_die("Unable to perform warptool -setskyfiletoupdate: $error_code", $exposure->{exp_id}, $data_group);
     302    }
     303   
     304    $exposure->{active} = 1;
     305    return($exposure);
     306}
     307       
     308sub determine_if_can_update {
     309    my $exposure = shift;
     310   
     311    if (S64_IS_NOT_NULL($exposure->{chip_id})) {
     312        if (($exposure->{chip_state} eq 'cleaned')||
     313            ($exposure->{chip_state} eq 'goto_cleaned')||
     314            ($exposure->{chip_state} eq 'error_cleaned')) {
     315            return(1);
     316        }
     317    }
     318
     319    return(0);
     320}
     321       
    202322
    203323# This is the "user level" subroutine.
     
    240360        my $comment = $exposure->{comment};
    241361
    242         # This is a hack to fix old exposures that have no object.
     362        my $updateable = determine_if_can_update($exposure);
     363
     364        # This is a hack to fix old exposures that have no usable object/comment data.
    243365        unless(defined($comment)) {
    244366            $comment = '';
     
    247369            if ($comment =~ /3pi_/) {
    248370                $object = $comment;
    249                 $object =~ s/^.*?(3pi_\d\d_\d\d\d\d).*?$/$1/;
     371                $object =~ s/^.*?(3pi_\d\d_\d\d\d\d).*?$/F1 $1/;
    250372            }
    251373            elsif ($comment =~ / ps1_/) {
    252374                $object = $comment;
    253                 $object =~ s/^.*?(ps1_\d\d_\d\d\d\d).*$/$1/;
    254             }
    255             else {
    256                 $exposure->{data_state} = 'new';
     375                $object =~ s/^.*?(ps1_\d\d_\d\d\d\d).*$/F2 $1/;
     376            }
     377            elsif ($comment =~ /ThreePi.*3pi_/) {
     378                $object = $comment;
     379                $object =~ s/^ThreePi . (\S+? 3pi_\d\d_\d\d\d\d) .*$/F3 $1/;
     380            }           
     381            elsif ($comment =~ /ThreePi.*ps1_/) {
     382                $object = $comment;
     383                $object =~ s/^ThreePi . (\S+? ps1_\d\d_\d\d\d\d) .*$/F4 $1/;
     384            }           
     385            elsif ($comment =~ /ThreePi /) {
     386                $object = $comment;
     387                $object =~ s/^ThreePi . (\S+? \d\d\d\d) .*$/F5 $1/;
     388            }           
     389            elsif (($comment =~ /focus/i)||
     390                   ($comment =~ /test/i)||
     391                   ($comment =~ /hyster/i)||
     392                   ($comment =~ /dither/i)||
     393                   ($comment =~ /camera/i)
     394                ){
     395                # This is junk that shouldn't exist.
     396                $object = 'DROP';
     397                $exposure->{data_state} = 'drop';
    257398                $exposure->{pairwise} = 0;
    258                 $exposure->{private} = 1;
    259                 $exposure->{pair_id} = 9223372036854775807;
    260                 update_this_exposure($exposure);
    261                 $exposure = remake_this_exposure($exposure);
    262                 $counter++;
     399                $exposure->{pair_id} =  9223372036854775807;
     400                $exposure->{active} = 0;
     401                &update_this_exposure($exposure);
     402                $counter++; # To ensure everyone else is consistent
    263403                next;
    264404            }
    265405        }
    266406
     407        # Determine the current state of chipRuns for these exposures, and update/remake as needed.
    267408        if (S64_IS_NOT_NULL($chip_id)) { # We already have a defined chip_id
    268409            if (($pairwise) && !($pair_id)) {
     
    270411                &my_die("Exposure $exp_id for $lap_id is declared pairwise without a defined pair", $lap_id);
    271412            }
     413            $exposure->{data_state} = 'exists';
     414            if ($updateable) { # We know about this run, but the data needs to be regenerated.
     415                $exposure->{data_state} = 'update';
     416                $exposure = remake_this_exposure_by_update($exposure);
     417            }
     418            &update_this_exposure($exposure);
    272419            $matching{$object}{$comment} = $exp_id;
    273420            $indexing{$exp_id} = $counter;
    274421            $counter++;
    275             next;
    276422        }
    277423        else { # We do not already have a chip_id. 
    278424            # Make a chipRun, and update the exposure.
     425            $exposure->{data_state} = 'run';
    279426            $exposure = remake_this_exposure($exposure);
    280            
    281427            # Save our information for diff pairing.
     428            &update_this_exposure($exposure);
    282429            $matching{$object}{$comment} = $exp_id;
    283430            $indexing{$exp_id} = $counter;
    284431            $counter++;
    285432        }
     433
    286434        if ($verbose) {
    287435            print "ZZ: $exp_id $object $comment $matching{$object}{$comment}\n";
     
    296444            print "$object $comment $matching{$object}{$comment} $indexing{$matching{$object}{$comment}} $exp_ids_to_diff[-1]\n";
    297445        }
    298         @exp_ids_to_diff = sort { $indexing{$a} <=> $indexing{$b} } @exp_ids_to_diff;
     446        @exp_ids_to_diff = sort { $indexing{$a} <=> $indexing{$b} } @exp_ids_to_diff; # This is effectively a sort by dateobs.
    299447       
    300448        if (( $#exp_ids_to_diff + 1) % 2 != 0) { # We have an odd number of exposures, even after comment filtering
     
    309457            my $exp_B = ${ $exposures }[$indexing{$exp_id_B}];
    310458            print "$exp_A $exp_B $exp_id_A $exp_id_B $indexing{$exp_id_A} $indexing{$exp_id_B}\n";
    311             $exp_A->{pairwise} = 1;
    312             $exp_A->{private} = 0;
    313             $exp_A->{pair_id} = $exp_B->{chip_id};
    314            
    315             $exp_B->{pairwise} = 1;
    316             $exp_B->{private} = 0;
    317             $exp_B->{pair_id} = $exp_A->{chip_id};
    318            
    319             if ($verbose) {
    320                 print "LAP_DIFFS: $object: $exp_A->{exp_id} and $exp_B->{exp_id} are a pair\n";
     459            if ($exp_A->{diff_id} == $exp_B->{diff_id}) {
     460                $exp_A->{pairwise} = 1;
     461                $exp_A->{pair_id} = $exp_B->{chip_id};
     462               
     463                $exp_B->{pairwise} = 1;
     464                $exp_B->{pair_id} = $exp_A->{chip_id};
     465                if ($verbose) {
     466                    print "LAP_DIFFS: $object: $exp_A->{exp_id} and $exp_B->{exp_id} are a pair\n";
     467                }
     468            }
     469            else {
     470                $exp_A->{pairwise} = 0;
     471                $exp_B->{pairwise} = 0;
    321472            }
    322473        }
     
    331482            $exposure->{pairwise} = 0; # We marked it for pairwise diffs, but didn't match it. Probably an error.
    332483        }
    333         if (!($exposure->{pairwise})) {
    334             $exposure->{private} = 1; # If this isn't being pairwise diffed, it needs to be private
    335         }
    336 
     484       
    337485        update_this_exposure($exposure);
    338486    }
     
    457605    # Things I want to know before I'm through
    458606#     my $needs_qstack = 0;
    459     my $needs_something_remade = 0;
    460     my $needs_something_private = 0;
     607    my $needs_something_remade = 0;  # I never need something remade, because we're committed to one-exp=one-chip
     608    my $needs_something_private = 0; # I never need something private, as that is calculated by the difference engine.
    461609#     my $can_qstack = 0;
    462610     my $have_diff = 0;
     
    480628            else { # We claimed to be pairwise, but do not have a valid pair_id.
    481629                $exposure->{pairwise} = 0;
    482                 $exposure->{private} = 1;
    483630                &update_this_exposure($exposure);
    484631            }
     
    487634        if  ($exposure->{data_state} eq 'drop') { # This exposure is impossible, so fudge the counts so we get through.
    488635            $are_warped++;
    489 #           $can_qstack ++;
    490636            $can_diff ++;
    491637            $have_diff ++;
    492638            $are_magicked ++;
    493 #           $can_fstack ++;         
     639            next;
     640        }
     641
     642        if ($exposure->{data_state} eq 'pending_update') {
     643            $exposure->{data_state} = 'update';
     644            $exposure = &remake_this_exposure_by_update($exposure);
     645            &update_this_exposure($exposure);
    494646            next;
    495647        }
    496648       
    497649        if ($exposure->{private}) { # I've declared this exposure private to this lapRun.
    498 #           $needs_qstack++;
    499650            push @lonely_exposures, $exposure;
    500 #           $lonely_exposures++;
    501651        }
    502652       
    503         if ($exposure->{needs_remade}) { # This does the check that private = false for other lapRun
    504             $needs_something_remade = 1;
    505             $exposure = remake_this_exposure($exposure);
    506         }
     653#       if ($exposure->{needs_remade}) { # This does the check that private = false for other lapRun
     654#           $needs_something_remade = 1;
     655#           $exposure = remake_this_exposure($exposure);
     656#       }
    507657        # Do quality checks here
    508658        my $is_bad_quality = 0;
     
    536686                    ($exposure->{diffRun_state} eq 'full')) {
    537687                $are_warped++;
    538 #               $needs_qstack++;
    539                 $needs_something_private = 1;
    540688                if ($companion) {
    541                     $companion->{private} = 1;
    542689                    $companion->{pairwise} = 0;
    543690                    &update_this_exposure($companion);
    544                     push @lonely_exposures, $companion;
    545 #                   $lonely_exposures++;
    546                 }
    547                 $exposure->{private} = 1;
     691#                   push @lonely_exposures, $companion;
     692                }
    548693                $exposure->{pairwise} = 0;
    549694            }
    550695            $exposure->{data_state} = 'drop';
    551696            &update_this_exposure($exposure);
     697            next;
    552698        }
    553699       
     
    558704#           $can_qstack ++;
    559705            $can_diff ++;
    560         }
    561         if (($exposure->{magicked}&&
    562              &S64_IS_NOT_NULL($exposure->{magicked}))) {  # This exposure has been magicked, so it is through with diff.
    563             $are_magicked++;
    564 #           $can_fstack ++;
     706            $exposure->{data_state} = 'to_diff';
    565707        }
    566708        if (($exposure->{diff_id})&&(&S64_IS_NOT_NULL($exposure->{diff_id}))) {
    567709            $have_diff ++;
    568         }
     710            $exposure->{data_state} = 'to_magic';
     711        }
     712        if (($exposure->{magicked})&&
     713            ($exposure->{warpRun_state})&&
     714            ($exposure->{warpRun_state} eq 'full')&&
     715            (&S64_IS_NOT_NULL($exposure->{magicked}))) {  # This exposure has been magicked, so it is through with diff.
     716            $are_magicked++;
     717            $exposure->{data_state} = 'full';
     718#           $can_fstack ++;
     719        }
     720        &update_this_exposure($exposure);
    569721    }
    570722
     
    575727    print "STATUS: HAVE_FSTACK:     $have_fstack\n";
    576728
    577 #    print "STATUS: NEEDS_QSTACK:    $needs_qstack\n";
    578729    print "STATUS: NEEDS_REMADE:    $needs_something_remade\n";
    579730    print "STATUS: NEEDS PRIVATIZE: $needs_something_private\n";
    580731    print "STATUS: ARE WARPED:      $are_warped\n";
    581732    print "STATUS: ARE MAGICKED:    $are_magicked\n";
    582 #    print "STATUS: CAN_QSTACK:      $can_qstack\n";
    583733    print "STATUS: CAN_DIFF:        $can_diff\n";
    584734    print "STATUS: HAVE_DIFF:       $have_diff\n";
    585 #    print "STATUS: CAN_FSTACK:      $can_fstack\n";
    586735
    587736    print "STATUS: TOTAL_EXPOSURES: $total_exposures\n";
     
    9241073            next;
    9251074        }
    926         if ($exposure->{diff_id}&&S64_IS_NOT_NULL($exposure->{diff_id})) { # Not sure how this would happen, but still. ## This happens when we inherit a complete exposure.
     1075        if ($exposure->{diff_id}&&S64_IS_NOT_NULL($exposure->{diff_id})) { # This happens when we inherit a complete exposure.
    9271076            next;
    9281077        }
     
    9641113        }
    9651114        else { # warp-qstack
     1115            # We need to decide if we can make a warp-stack diff:
     1116            if (&can_warp_stack_diff_be_made($exposure)) {
    9661117#           next;
    9671118#           $command .= '-pretend';
    968             $command .= " -definewarpstack -available -good_frac 0.2 ";
    969             $command .= " -warp_id $exposure->{warp_id} -stack_label ${label} ";
    970             $already_queued{$exposure->{warp_id}} = 1;
     1119                $command .= " -definewarpstack -available -good_frac 0.2 ";
     1120                $command .= " -warp_id $exposure->{warp_id} -stack_label ${label} ";
     1121                $already_queued{$exposure->{warp_id}} = 1;
     1122                $exposure->{private} = 0;
     1123                &update_this_exposure($exposure);
     1124            }
     1125            else {
     1126                $exposure->{private} = 1;
     1127                $exposure->{data_state} = 'drop';
     1128                $already_queued{$exposure->{warp_id}} = 1;
     1129                &update_this_exposure($exposure);
     1130                next;
     1131            }
    9711132        }
    9721133       
     
    10061167}
    10071168
     1169sub can_warp_stack_diff_be_made {
     1170    my $exposure = shift;
     1171    my $lap_id   = $exposure->{lap_id};
     1172    my $warp_id  = $exposure->{warp_id};
     1173
     1174    my $command = "$laptool -diffcheck -lap_id $lap_id -warp_id $warp_id";
     1175    $command .= " -dbname $dbname " if defined $dbname;
     1176
     1177    my ($success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     1178        run(command => $command, verbose => $verbose);
     1179    unless ($success) {
     1180        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     1181        &my_die("Unable to perform laptool -diffcheck: $error_code", $lap_id, $warp_id);
     1182    }
     1183    if (@$stdout_buf == 0) {
     1184        return(0);
     1185    }
     1186    my $skycells = $mdcParser->parse_list(join "", @$stdout_buf) or
     1187        &my_die("Unable to parse metadata from laptool -diffcheck", $lap_id, $warp_id);
     1188    foreach my $skycell (@$skycells) {
     1189        unless (defined($skycell->{stack_state})) {
     1190            return(0);
     1191        }
     1192        if ($skycell->{stack_state} ne 'full') {
     1193            return(0);
     1194        }
     1195        if ($skycell->{warp_state} ne 'full') {
     1196            return(0);
     1197        }
     1198        unless (S64_IS_NOT_NULL($skycell->{stack_id})) {
     1199            return(0);
     1200        }
     1201    }
     1202    return(1);
     1203}
     1204
     1205
    10081206# Deactivate all exposures in this run.
    10091207sub deactivate_exposures {
    10101208    my $exposures = shift;
    10111209    foreach my $exposure (@$exposures) {
    1012         $exposure->{active} = 0;
    1013         update_this_exposure($exposure);
     1210        if ($exposure->{private} == 1) {  # This can probably be relaxed since we can update an undestreaked warp.
     1211            $exposure->{active} = 1;
     1212        }
     1213        else {
     1214            $exposure->{active} = 0;
     1215        }
     1216        update_this_exposure($exposure);       
    10141217    }
    10151218}
     
    10221225sub cleanup_mode {
    10231226    my $lap_id = shift;
     1227
     1228    if (defined($queue_list)) {
     1229        my $successful = 1;
     1230        open(Q,$queue_list) or ($successful = 0);
     1231        if ($successful == 1) {
     1232            while(<Q>) {
     1233                chomp;
     1234                my $cmd = $_;
     1235                my ($projection_cell,$seq_id,$filter,$label);
     1236                $projection_cell = $cmd;
     1237                $projection_cell =~ s/.*?-projection_cell (skycell.\w+?) .*/$1/;
     1238                $seq_id = $cmd;
     1239                $seq_id =~ s/.*-seq_id (\d+?) .*/$1/;
     1240                $filter = $cmd;
     1241                $filter =~ s/.*-filter (\w\.00000) .*/$1/;
     1242                if ($filter =~ /\s+?/) {
     1243                    $filter =~ s/.*-filter (\w\.00000)$/$1/;
     1244                }
     1245                $label = $cmd;
     1246                $label =~ s/.*-label (.+?) .*/$1/;
     1247               
     1248                my $response;
     1249                chomp($response =
     1250                      `laptool -dbname gpc1 -listrun -projection_cell $projection_cell -seq_id $seq_id -filter $filter -label $label -simple`);
     1251                my $state = (split /\s+/, $response)[5];
     1252               
     1253                unless (defined($state)) {
     1254                    if ($verbose) {
     1255                        print "Queuing: $cmd\n";
     1256                    }
     1257                    system($cmd);
     1258                   
     1259                    my $i = 0;
     1260                    do {
     1261                        sleep(5);
     1262                        chomp($response =
     1263                              `laptool -dbname gpc1 -listrun -projection_cell $projection_cell -seq_id $seq_id -filter $filter -label $label -simple`);
     1264                        $state = (split /\s+/, $response)[5];
     1265                        $i++;
     1266                        unless(defined($state)) {
     1267                            $successful = 0;
     1268                        }
     1269                    } while (($state ne 'run')&&($i < 20)&&($successful));
     1270                    last;
     1271                }
     1272            }
     1273            close(Q);
     1274        }
     1275    }
     1276
    10241277    my $command = "$laptool -inactiveexp -lap_id $lap_id ";
    10251278    $command .= " -dbname $dbname " if defined $dbname;
     
    10431296        'warptool -dbname @DBNAME@ -updaterun -set_state goto_cleaned -set_label goto_cleaned -label @LABEL@ -warp_id @WARP_ID@',
    10441297        'difftool -dbname @DBNAME@ -updaterun -set_state goto_cleaned -set_label goto_cleaned -label @LABEL@ -diff_id @DIFF_ID@',
     1298        'magictool -dbname @DBNAME@ -updaterun -set_state full -set_label @LABEL@.old -magic_id @MAGIC_ID@',
    10451299        'magicdstool -dbname @DBNAME@ -updaterun -set_state goto_cleaned -state full -set_label goto_cleaned -stage chip -stage_id @CHIP_ID@',
    10461300        'magicdstool -dbname @DBNAME@ -updaterun -set_state goto_cleaned -state full -set_label goto_cleaned -stage warp -stage_id @WARP_ID@',
    10471301        'magicdstool -dbname @DBNAME@ -updaterun -set_state goto_cleaned -state full -set_label goto_cleaned -stage diff -stage_id @DIFF_ID@');
     1302   
    10481303    foreach my $exposure (@$exposures) {
    10491304        if ($exposure->{is_in_use}) {
     
    10721327                if (S64_IS_NOT_NULL($exposure->{diff_id})) {
    10731328                    $command =~ s/\@DIFF_ID\@/$exposure->{diff_id}/;
     1329                }
     1330                else {
     1331                    next;
     1332                }
     1333            }
     1334            if ($command =~ /\@MAGIC_ID\@/) {
     1335                if ((S64_IS_NOT_NULL($exposure->{magicked}))&&
     1336                     ($exposure->{magicked} > 0)) {
     1337                    $command =~ s/\@MAGIC_ID\@/$exposure->{magicked}/;
    10741338                }
    10751339                else {
     
    11391403        &my_die("Unable to perform laptool -updaterun: $error_code", $lap_id);
    11401404    }
    1141 
     1405    return(0);
    11421406}
    11431407   
Note: See TracChangeset for help on using the changeset viewer.