Changeset 412
- Timestamp:
- Sep 5, 2019, 11:37:15 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/project-meta/project-meta
r411 r412 8 8 use strict; 9 9 use warnings; 10 use version; our $VERSION = version->declare('0.2. 2');10 use version; our $VERSION = version->declare('0.2.3'); 11 11 12 12 use File::Copy qw(copy); … … 146 146 project-meta version 147 147 project-meta check 148 project-meta dap-publish 149 project-meta dap-unpublish 148 project-meta dap-publish [--verbose|-v] [--dataset|-d dataset] 149 project-meta dap-unpublish [--verbose|-v] [--dataset|-d dataset] 150 150 project-meta dataset-list 151 151 project-meta dataset-size [--verbose|-v] [--dataset|-d dataset] … … 213 213 214 214 sub cmd_dap_publish { 215 local @ARGV = @_; 216 my ($verbose, $dataset_name); 217 218 Getopt::Long::GetOptions( 219 'verbose' => \$verbose, 220 'dataset|d=s' => \$dataset_name, 221 ); 222 215 223 my $meta = load_metadata(); 216 224 my $current_dir = Cwd::getcwd(); … … 218 226 my $dap_folder = $meta->{'public-dap'}{'dap-folder'}; 219 227 my $data_set = $meta->{'public-dap'}{'data-set'}; 228 if ($dataset_name) { 229 if (exists $meta->{'public-dap'}{'data-set'}{$dataset_name}) { 230 $data_set = $meta->{'public-dap'}{'data-set'}{$dataset_name}; 231 } 232 else { 233 die "Error, dataset $dataset_name does'nt exists\n"; 234 } 235 } 220 236 221 237 push @{$data_set}, 'AUTHORS.txt', 'COPYRIGHT.txt', 'LICENSE.txt'; … … 234 250 print "chmod o+rX,o-w '$current_dir'\n"; 235 251 print "mkdir -p '$dap_folder/$acronym'\n" if not -d "$dap_folder/$acronym"; 252 if ($dataset_name) { 253 $acronym .= "/$dataset_name"; 254 print "mkdir -p '$dap_folder/$acronym'\n" if not -d "$dap_folder/$acronym"; 255 } 236 256 for my $folder (sort keys %folders) { 237 257 print "chmod o+rX,o-w '$current_dir/$folder'\n"; … … 258 278 259 279 sub cmd_dap_unpublish { 280 local @ARGV = @_; 281 my ($verbose, $dataset_name); 282 283 Getopt::Long::GetOptions( 284 'verbose' => \$verbose, 285 'dataset|d=s' => \$dataset_name, 286 ); 287 260 288 my $meta = load_metadata(); 261 289 my $current_dir = Cwd::getcwd(); 262 290 my $acronym = $meta->{'project'}{'identifier'}{'acronym'}; 263 291 my $dap_folder = $meta->{'public-dap'}{'dap-folder'}; 292 my $data_set = $meta->{'public-dap'}{'data-set'}; 293 if ($dataset_name) { 294 if (exists $meta->{'public-dap'}{'data-set'}{$dataset_name}) { 295 $data_set = $meta->{'public-dap'}{'data-set'}{$dataset_name}; 296 } 297 else { 298 die "Error, dataset $dataset_name does'nt exists\n"; 299 } 300 } 264 301 265 302 die "Error: DAP folder match current folder" if $dap_folder =~ m{$current_dir} or $current_dir =~ m{$dap_folder}; 266 303 304 $acronym .= "/$dataset_name" if $dataset_name; 267 305 print "find '$dap_folder/$acronym/' -type l -o -type d -exec ls -l {} \+\n"; 268 306 print "find '$dap_folder/$acronym/' -type l -delete\n"; … … 547 585 project-meta version 548 586 project-meta check 549 project-meta dap-publish 550 project-meta dap-unpublish 587 project-meta dap-publish [--verbose|-v] [--dataset|-d dataset] 588 project-meta dap-unpublish [--verbose|-v] [--dataset|-d dataset] 551 589 project-meta dataset-list 552 590 project-meta dataset-size [--verbose|-v] [--dataset|-d dataset] … … 587 625 =head2 dap-publish 588 626 589 project-meta dap-publish 627 project-meta dap-publish [--verbose|-v] [--dataset|-d dataset] 590 628 591 629 Publish data on an OpeNDAP server. … … 610 648 You have to verify ouput before eval it. 611 649 612 project-meta dap-publish613 project-meta dap-publish | bash650 project-meta dap-publish 651 project-meta dap-publish | bash 614 652 615 653 =head2 dap-unpublish 616 654 617 project-meta dap-unpublish 655 project-meta dap-unpublish [--verbose|-v] [--dataset|-d dataset] 618 656 619 657 Unpublish data from the OpeNDAP server.
Note: See TracChangeset
for help on using the changeset viewer.