Changeset 17748 for trunk/DataStoreServer/scripts/dsreg
- Timestamp:
- May 19, 2008, 2:51:31 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/DataStoreServer/scripts/dsreg (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/DataStoreServer/scripts/dsreg
r16879 r17748 9 9 use Getopt::Long qw( GetOptions ); 10 10 use Pod::Usage qw( pod2usage ); 11 use Digest::MD5::File qw( file_md5_hex ); 11 use Digest::MD5::File qw( file_md5_hex ); 12 12 use DBI; 13 13 use PS::IPP::Metadata::Config; … … 17 17 18 18 use PS::IPP::Config qw($PS_EXIT_SUCCESS 19 $PS_EXIT_UNKNOWN_ERROR20 $PS_EXIT_SYS_ERROR21 $PS_EXIT_CONFIG_ERROR22 $PS_EXIT_PROG_ERROR23 $PS_EXIT_DATA_ERROR24 $PS_EXIT_TIMEOUT_ERROR25 metadataLookupStr26 metadataLookupBool27 caturi28 );19 $PS_EXIT_UNKNOWN_ERROR 20 $PS_EXIT_SYS_ERROR 21 $PS_EXIT_CONFIG_ERROR 22 $PS_EXIT_PROG_ERROR 23 $PS_EXIT_DATA_ERROR 24 $PS_EXIT_TIMEOUT_ERROR 25 metadataLookupStr 26 metadataLookupBool 27 caturi 28 ); 29 29 my $product; 30 30 my $fileset; … … 43 43 my $copyfiles; # if set, copy files from this directory to the Data Store fileset 44 44 my $datapath; # source for files required if $linkfiles or $copyfiles 45 my $dbname; # Database name 45 46 46 47 my $ds_dir; … … 62 63 'add' => \$add, 63 64 'del' => \$del, 64 'product=s' =>\$product,65 'fileset=s' =>\$fileset,66 'type=s' =>\$fstype,65 'product=s' => \$product, 66 'fileset=s' => \$fileset, 67 'type=s' => \$fstype, 67 68 'datapath=s' => \$datapath, 68 69 'link' => \$linkfiles, 69 70 'copy' => \$copyfiles, 70 71 'rm' => \$remove, 71 'ps0=s' => \$ps0, # product specific columns 0 - 7 72 'ps1=s' => \$ps1, 73 'ps2=s' => \$ps2, 74 'ps3=s' => \$ps3, 75 'ps4=s' => \$ps4, 76 'ps5=s' => \$ps5, 77 'ps6=s' => \$ps6, 78 'ps7=s' => \$ps7 72 'ps0=s' => \$ps0, # product specific columns 0 - 7 73 'ps1=s' => \$ps1, 74 'ps2=s' => \$ps2, 75 'ps3=s' => \$ps3, 76 'ps4=s' => \$ps4, 77 'ps5=s' => \$ps5, 78 'ps6=s' => \$ps6, 79 'ps7=s' => \$ps7 80 'dbname' => \$dbname, 79 81 ) or pod2usage(2); 80 82 … … 127 129 128 130 my $dbserver = metadataLookupStr($siteConfig, 'DBSERVER'); 129 my $dbname = metadataLookupStr($siteConfig, 'DBNAME');131 $dbname = metadataLookupStr($siteConfig, 'DBNAME') unless defined $dbname; 130 132 my $dbuser = metadataLookupStr($siteConfig, 'DBUSER'); 131 133 my $dbpass = metadataLookupStr($siteConfig, 'DBPASSWORD'); … … 232 234 while (<STDIN>) { 233 235 $lineno++; 234 236 235 237 my $filename; 236 238 my $filetype; … … 246 248 $filetype = shift @fields; 247 249 248 # 250 # 249 251 # save any type specific fields provided in the string to be added to the 250 252 # VALUES list for this file … … 265 267 ."($path does not exist.\n"); 266 268 } 267 269 268 270 # Get MD5 sum 269 271 my $md5 = file_md5_hex($path); 270 272 271 my $hashref = { 273 my $hashref = { 272 274 'file' => $filename, 273 275 'bytes' => $finfo[7], … … 283 285 die("empty filelist"); 284 286 } 285 287 286 288 # 287 289 # Prepare the fileset directory … … 316 318 die("failed to remove $fileset_dir"); 317 319 } 318 320 319 321 exit $PS_EXIT_UNKNOWN_ERROR; 320 322 } … … 401 403 402 404 pod2usage( 403 -msg => 405 -msg => 404 406 "usage: $tmp[$#tmp] [--add|--del] --product prod_name --fileset fs_name --type fs_type [options] 405 407 … … 422 424 --ps0 - ps7 Optional product specific data 423 425 --rm with --del remove the fileset directory from the Data Store 424 426 425 427 $str", 426 428 -exitval => 2
Note:
See TracChangeset
for help on using the changeset viewer.
