IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 11288


Ignore:
Timestamp:
Jan 24, 2007, 5:39:31 PM (19 years ago)
Author:
jhoblitt
Message:

add --overwrite option to dsleech

Location:
trunk/DataStore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/DataStore/Changes

    r10249 r11288  
    44    - fix dsleech to handle valid but empty filesets
    55    - change dsfilesetls to output "extra" fields
     6    - add --overwrite option to dsleech
    67
    780.05 Fri Sep  1 11:28:13 HST 2006
  • trunk/DataStore/lib/DataStore.pm

    r8728 r11288  
    11# Copyright (C) 2006  Joshua Hoblitt
    22#
    3 # $Id: DataStore.pm,v 1.8 2006-09-01 21:19:04 jhoblitt Exp $
     3# $Id: DataStore.pm,v 1.9 2007-01-25 03:39:31 jhoblitt Exp $
    44
    55package DataStore;
     
    99
    1010use vars qw($VERSION);
    11 $VERSION = '0.05';
     11$VERSION = '0.06';
    1212
    1313=pod
  • trunk/DataStore/scripts/dsleech

    r9827 r11288  
    33# Copyright (C) 2006  Joshua Hoblitt
    44#
    5 # $Id: dsleech,v 1.4 2006-11-02 03:15:08 jhoblitt Exp $
     5# $Id: dsleech,v 1.5 2007-01-25 03:39:31 jhoblitt Exp $
    66
    77use strict;
     
    2424    'uri|u=s'           => \$uri,
    2525    'last_fileset|l=s'  => \$last_fileset,
     26    'overwrite|o'       => \$overwrite,
    2627    'recall'            => \$recall,
    2728    'remember'          => \$remember,
     
    7172}
    7273
    73 process_filesets($filesets, $dir, $verbose) or die "failed to process filesets";
     74process_filesets($filesets, $dir, $overwrite, $verbose) or die "failed to process filesets";
    7475
    7576# if we got this far we're assuming that the downloads completed and we can
     
    8687sub process_filesets
    8788{
    88     my ($filsets, $dir, $verbose) = @_;
     89    my ($filsets, $dir, $overwrite $verbose) = @_;
    8990
    9091    foreach my $fileset (@$filesets) {
     
    104105        }
    105106
    106         if (!process_files($files, $dir, $verbose)) {
     107        if (!process_files($files, $dir, $overwrite, $verbose)) {
    107108            warn "failed to process files";
    108109            return;
     
    115116sub process_files
    116117{
    117     my ($files, $dir, $vebose) = @_;
     118    my ($files, $dir, $overwrite, $vebose) = @_;
    118119
    119120    foreach my $file (@$files) {
     
    137138        # make sure that filename doesn't already exist
    138139        if (-e $filename) {
    139             warn "file $filename already exists, skipping...";
    140             next;
     140            if ($overwrite) {
     141                warn "file $filename already exists, overwriting...";
     142            } else {
     143                warn "file $filename already exists, skipping...";
     144                next;
     145            }
    141146        }
    142147
     
    226231This flag is optional.
    227232
     233=item * --overwrite
     234
     235If a file already exists, overwrite it.
     236
     237This flag is optional.
     238
    228239=item * --recall
    229240
Note: See TracChangeset for help on using the changeset viewer.