Changeset 17526 for trunk/DataStore/scripts/dsget
- Timestamp:
- May 5, 2008, 10:26:46 AM (18 years ago)
- File:
-
- 1 edited
-
trunk/DataStore/scripts/dsget (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/DataStore/scripts/dsget
r17451 r17526 3 3 # Copyright (C) 2006-2008 Joshua Hoblitt 4 4 # 5 # $Id: dsget,v 1.1 6 2008-04-18 00:50:26 jhoblitt Exp $5 # $Id: dsget,v 1.17 2008-05-05 20:26:46 jhoblitt Exp $ 6 6 7 7 use strict; … … 15 15 use File::Temp (); 16 16 use File::Basename qw( basename dirname ); 17 use Nebulous::Keys qw( parse_neb_key );18 17 19 18 use Getopt::Long qw( GetOptions :config auto_help auto_version gnu_getopt ); … … 32 31 'md5|m=s' => \$md5, 33 32 'filename|f=s' => \$filename, 34 'compress '=> \$compress,33 'compress|c' => \$compress, 35 34 ) or pod2usage( 2 ); 36 35 … … 41 40 ) unless defined $uri and defined $filename; 42 41 43 # if --nebulous is specified, parse the nebulous name 44 my ($uriVolume, $uriFilename); 45 if ($nebulous) { 46 ($uriVolume, $uriFilename) = parse_neb_key ($filename); 47 } 42 # XXX EAM : should not need parse_neb_key, but how to handle case 43 # where we supply --volume and neb://volume/path ? 44 # 1) parse anyway and check for conflict 45 # 2) drop --volume option 46 # JH: the Nebulous server contains the policy to handle this conflict. 47 # At present --volume will overide the volume in neb://volume/... 48 48 49 49 # --volume implies --nebulous … … 51 51 $nebulous ||=1; 52 52 } 53 54 if ($volume and $uriVolume and ($volume ne $uriVolume)) {55 die "conflicting volume names specified";56 }57 58 if ($uriVolume) { $volume = $uriVolume; }59 if ($uriFilename) { $filename = $uriFilename; }60 61 # XXX EAM : should not need parse_neb_key, but how to handle case62 # where we supply --volume and neb://volume/path ?63 # 1) parse anyway and check for conflict64 # 2) drop --volume option65 53 66 54 if ($compress) { … … 144 132 unless defined $neb; 145 133 146 # XXX see comment above a nd not blindly stomping147 # if the key doesn't already exist then create it148 # if it does, delete it so that we end up on the right storage volume134 # XXX see comment above about not blindly stomping the file 135 # - if the key doesn't already exist then create it 136 # - if it does, delete it so that we end up on the right storage volume 149 137 if ($neb->stat($filename)) { 150 138 $neb->delete($filename) … … 180 168 =head1 SYNOPSIS 181 169 182 dsget --uri <uri> --filename <filename> [--bytes <nbytes>] [--md5 <hex>] [--compress]183 [-- nebulous] [--volume <volume name>]170 dsget --uri <uri> --filename <filename> [--bytes <nbytes>] [--md5 <hex>] 171 [--compress] [--nebulous] [--volume <volume name>] 184 172 185 173 =head1 DESCRIPTION … … 213 201 Flag to enable C<nebulous> support. When set C<--filename> is used as the 214 202 Nebulous key. 203 204 Optional. 205 206 =item * --compress|-c 207 208 When set C<dsget> will request a compressed version of the file. 215 209 216 210 Optional.
Note:
See TracChangeset
for help on using the changeset viewer.
