IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 24, 2009, 4:27:56 PM (17 years ago)
Author:
bills
Message:

fix some problems with distribution that were introduced by the removal of table rcDSProduct

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippScripts/scripts/dist_make_fileset.pl

    r25432 r25567  
    3939
    4040# Parse the command-line arguments
    41 my ($dist_id, $dist_dir, $target_id, $stage, $stage_id, $prod_id, $product_name, $ds_dbhost, $ds_dbname);
     41my ($dist_id, $dist_dir, $target_id, $stage, $stage_id, $dest_id, $product_name, $ds_dbhost, $ds_dbname);
    4242my ($dbname, $save_temps, $verbose, $no_update, $logfile);
    4343
     
    4848           'stage=s'        => \$stage,      # raw, chip, camera, fake, warp, stack, or diff
    4949           'stage_id=s'     => \$stage_id,   # exp_id, chip_id, etc.
    50            'prod_id=s'      => \$prod_id,    # id for the product
     50           'dest_id=s'      => \$dest_id,    # id for the product
    5151           'product_name=s' => \$product_name,  # location of the data store directory for this product
    5252           'ds_dbhost=s'    => \$ds_dbhost,  # database host for the datastore database
     
    6060
    6161pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
    62 pod2usage( -msg => "Required options: --dist_id --dist_dir --target_id --stage --stage_id --prod_id --ds_dbhost --ds_dbname",
     62pod2usage( -msg => "Required options: --dist_id --dist_dir --target_id --stage --stage_id --dest_id --ds_dbhost --ds_dbname",
    6363           -exitval => 3) unless
    6464    defined $dist_id and
     
    6767    defined $stage and
    6868    defined $stage_id and
    69     defined $prod_id and
     69    defined $dest_id and
    7070    defined $product_name and
    7171    defined $ds_dbhost and
     
    7979my $fs_tag = get_fileset_tag($ipprc, $stage, $stage_id, $dbname);
    8080
    81 &my_die("failed to lookup fileset tag", $dist_id, $prod_id, $PS_EXIT_UNKNOWN_ERROR) if !defined $fs_tag;
    82 
    83 my $fileset_name = "$fs_tag$stage.$stage_id.$dist_id.$prod_id";
     81&my_die("failed to lookup fileset tag", $dist_id, $dest_id, $PS_EXIT_UNKNOWN_ERROR) if !defined $fs_tag;
     82
     83my $fileset_name = $fs_tag ? "$fs_tag." : "";
     84$fileset_name .= "$stage.$stage_id.$dist_id.$dest_id";
    8485
    8586print "$fileset_name\n";
     
    8990my $dbinfo_file = "dbinfo.$stage.$stage_id.mdc";
    9091if (! -e "$dist_dir/$dbinfo_file" ) {
    91     &my_die("dbinfo file for dist run $dbinfo_file not found", $dist_id, $prod_id, $PS_EXIT_UNKNOWN_ERROR);
     92    &my_die("dbinfo file for dist run $dbinfo_file not found", $dist_id, $dest_id, $PS_EXIT_UNKNOWN_ERROR);
    9293}
    9394print "dbinfo file $dbinfo_file exists\n" if $verbose;
     
    9697my $dirinfo_file = "dirinfo.$stage.$stage_id.mdc";
    9798if (! -e "$dist_dir/$dirinfo_file" ) {
    98     &my_die("dirinfo file for dist run $dirinfo_file not found", $dist_id, $prod_id, $PS_EXIT_UNKNOWN_ERROR);
     99    &my_die("dirinfo file for dist run $dirinfo_file not found", $dist_id, $dest_id, $PS_EXIT_UNKNOWN_ERROR);
    99100}
    100101print "dirinfo file $dirinfo_file exists\n" if $verbose;
     
    116117    unless ($success) {
    117118        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    118         &my_die("Unable to perform $command error_code: $error_code", $dist_id, $prod_id, $error_code);
     119        &my_die("Unable to perform $command error_code: $error_code", $dist_id, $dest_id, $error_code);
    119120    }
    120121
    121122    my $metadata = $mdcParser->parse (join "", @$stdout_buf) or
    122         &my_die("Unable to parse metadata config doc", $dist_id, $prod_id, $PS_EXIT_PROG_ERROR);
     123        &my_die("Unable to parse metadata config doc", $dist_id, $dest_id, $PS_EXIT_PROG_ERROR);
    123124
    124125    $components = parse_md_list($metadata);
     
    153154
    154155    # set the product specific columns in product list
    155     $command .= " --ps0 $target_id --ps1 $stage --ps2 $stage_id --ps3 $fs_tag";
     156    my $prod_col_3 = $fs_tag ? $fs_tag : "$stage.$stage_id";
     157
     158    $command .= " --ps0 $target_id --ps1 $stage --ps2 $stage_id --ps3 $prod_col_3";
    156159
    157160    $command .= " --dbname $ds_dbname";    # XXX: notyet --dbhost $ds_dbhost
     
    161164    unless ($success) {
    162165        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    163         &my_die("Unable to perform $command error_code: $error_code", $dist_id, $prod_id, $error_code);
     166         &my_die("Unable to perform $command error_code: $error_code", $dist_id, $dest_id, $error_code);
    164167    }
    165168}
    166169
    167170{
    168     my $command = "$disttool -addfileset -dist_id $dist_id -prod_id $prod_id -name $fileset_name";
     171    my $command = "$disttool -addfileset -dist_id $dist_id -dest_id $dest_id -name $fileset_name";
    169172    $command .= " -dbname $dbname" if $dbname;
    170173
     
    175178        # We need to have revertfileset check whether the fileset exists and do dsreg -del if it does
    176179        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    177         &my_die("Unable to perform $command error_code: $error_code", $dist_id, $prod_id, $error_code);
     180        &my_die("Unable to perform $command error_code: $error_code", $dist_id, $dest_id, $error_code);
    178181    }
    179182}
     
    252255    my $msg = shift;
    253256    my $dist_id = shift;
    254     my $prod_id = shift;
     257    my $dest_id = shift;
    255258    my $fault = shift;
    256259
    257     # TODO: disttool -adddsfileset -prod_id $prod_id -dist_id $dist_id -fault $fault
     260    # TODO: disttool -adddsfileset -dest_id $dest_id -dist_id $dist_id -fault $fault
    258261    print STDERR "$msg\n";
    259262
    260     my $command = "$disttool -addfileset -dist_id $dist_id -prod_id $prod_id -fault $fault";
     263    my $command = "$disttool -addfileset -dist_id $dist_id -dest_id $dest_id -fault $fault";
    261264    $command .= " -dbname $dbname" if $dbname;
    262265
Note: See TracChangeset for help on using the changeset viewer.