IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 2, 2008, 3:04:36 PM (18 years ago)
Author:
bills
Message:

allow dbname and dsroot to be specified on the command line

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/DataStoreServer/scripts/dsprodtool

    r16877 r17885  
    2929my $description;
    3030
    31 my $ps0;
    32 my $ps1;
    33 my $ps2;
    34 my $ps3;
    35 my $ps4;
    36 my $ps5;
    37 my $ps6;
    38 my $ps7;
    39 
    40 my $ds_dir;
     31my ($ps0, $ps1, $ps2, $ps3, $ps4, $ps5, $ps6, $ps7);
     32
     33my $dsroot;
     34my $dbname;
    4135
    4236my $add;
     
    6054        'ps5=s'         =>      \$ps5,
    6155        'ps6=s'         =>      \$ps6,
    62         'ps7=s'         =>      \$ps7
     56        'ps7=s'         =>      \$ps7,
     57        'dbname=s'      =>      \$dbname,
     58        'dsroot=s'      =>      \$dsroot,
    6359) or pod2usage(2);
    6460
     
    8177}
    8278
    83 
    8479#
    8580# lookup the location of the Data Store
     
    8883my $ipprc =  PS::IPP::Config->new(); # IPP Configuration
    8984my $siteConfig = $ipprc->{_siteConfig};
    90 if (!$ds_dir) {
    91     $ds_dir = metadataLookupStr($ipprc->{_siteConfig}, 'PSTAMP_DATA_STORE_ROOT');
    92     if (!$ds_dir) {
     85if (!$dsroot) {
     86    $dsroot = metadataLookupStr($ipprc->{_siteConfig}, 'DATA_STORE_ROOT');
     87    if (!$dsroot) {
    9388        die("Data Store root directory not set");
    9489    }
    9590}
    9691
    97 my $root_index_script = "$ds_dir/index.txt";
     92my $root_index_script = "$dsroot/index.txt";
    9893if (!stat($root_index_script)) {
    99     $err .= "Data Store not found at '$ds_dir'.\n"
     94    $err .= "Data Store not found at '$dsroot'.\n"
    10095}
    10196
     
    105100
    106101my $dbserver = metadataLookupStr($siteConfig, 'DBSERVER');
    107 my $dbname   = metadataLookupStr($siteConfig, 'DBNAME');
     102$dbname      = metadataLookupStr($siteConfig, 'DBNAME') unless defined $dbname;
    108103my $dbuser   = metadataLookupStr($siteConfig, 'DBUSER');
    109104my $dbpass   = metadataLookupStr($siteConfig, 'DBPASSWORD');
     
    115110
    116111
    117 my $product_dir = "$ds_dir/$product";
     112my $product_dir = "$dsroot/$product";
    118113my $index_script_name = "$product_dir/index.txt";
    119114
Note: See TracChangeset for help on using the changeset viewer.