Changeset 25567 for trunk/ippScripts/scripts/dist_make_fileset.pl
- Timestamp:
- Sep 24, 2009, 4:27:56 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/ippScripts/scripts/dist_make_fileset.pl (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/dist_make_fileset.pl
r25432 r25567 39 39 40 40 # Parse the command-line arguments 41 my ($dist_id, $dist_dir, $target_id, $stage, $stage_id, $ prod_id, $product_name, $ds_dbhost, $ds_dbname);41 my ($dist_id, $dist_dir, $target_id, $stage, $stage_id, $dest_id, $product_name, $ds_dbhost, $ds_dbname); 42 42 my ($dbname, $save_temps, $verbose, $no_update, $logfile); 43 43 … … 48 48 'stage=s' => \$stage, # raw, chip, camera, fake, warp, stack, or diff 49 49 'stage_id=s' => \$stage_id, # exp_id, chip_id, etc. 50 ' prod_id=s' => \$prod_id, # id for the product50 'dest_id=s' => \$dest_id, # id for the product 51 51 'product_name=s' => \$product_name, # location of the data store directory for this product 52 52 'ds_dbhost=s' => \$ds_dbhost, # database host for the datastore database … … 60 60 61 61 pod2usage( -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",62 pod2usage( -msg => "Required options: --dist_id --dist_dir --target_id --stage --stage_id --dest_id --ds_dbhost --ds_dbname", 63 63 -exitval => 3) unless 64 64 defined $dist_id and … … 67 67 defined $stage and 68 68 defined $stage_id and 69 defined $ prod_id and69 defined $dest_id and 70 70 defined $product_name and 71 71 defined $ds_dbhost and … … 79 79 my $fs_tag = get_fileset_tag($ipprc, $stage, $stage_id, $dbname); 80 80 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 83 my $fileset_name = $fs_tag ? "$fs_tag." : ""; 84 $fileset_name .= "$stage.$stage_id.$dist_id.$dest_id"; 84 85 85 86 print "$fileset_name\n"; … … 89 90 my $dbinfo_file = "dbinfo.$stage.$stage_id.mdc"; 90 91 if (! -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); 92 93 } 93 94 print "dbinfo file $dbinfo_file exists\n" if $verbose; … … 96 97 my $dirinfo_file = "dirinfo.$stage.$stage_id.mdc"; 97 98 if (! -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); 99 100 } 100 101 print "dirinfo file $dirinfo_file exists\n" if $verbose; … … 116 117 unless ($success) { 117 118 $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); 119 120 } 120 121 121 122 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); 123 124 124 125 $components = parse_md_list($metadata); … … 153 154 154 155 # 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"; 156 159 157 160 $command .= " --dbname $ds_dbname"; # XXX: notyet --dbhost $ds_dbhost … … 161 164 unless ($success) { 162 165 $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); 164 167 } 165 168 } 166 169 167 170 { 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"; 169 172 $command .= " -dbname $dbname" if $dbname; 170 173 … … 175 178 # We need to have revertfileset check whether the fileset exists and do dsreg -del if it does 176 179 $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); 178 181 } 179 182 } … … 252 255 my $msg = shift; 253 256 my $dist_id = shift; 254 my $ prod_id = shift;257 my $dest_id = shift; 255 258 my $fault = shift; 256 259 257 # TODO: disttool -adddsfileset - prod_id $prod_id -dist_id $dist_id -fault $fault260 # TODO: disttool -adddsfileset -dest_id $dest_id -dist_id $dist_id -fault $fault 258 261 print STDERR "$msg\n"; 259 262 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"; 261 264 $command .= " -dbname $dbname" if $dbname; 262 265
Note:
See TracChangeset
for help on using the changeset viewer.
