Imported Upstream version 3.3.3
[debian/amanda] / server-src / amvault.pl
index 88111f7c9728b3324ce4e4d9911f450c235fd474..de47562eec2ca23b6cd58e42f6d5ac52773c348a 100644 (file)
@@ -1,9 +1,10 @@
 #! @PERL@
 # Copyright (c) 2008-2012 Zmanda, Inc.  All Rights Reserved.
 #
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 as published
-# by the Free Software Foundation.
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
 #
 # This program is distributed in the hope that it will be useful, but
 # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
@@ -440,7 +441,7 @@ sub scribe_started {
 
     my $xfers_finished = sub {
        my ($err) = @_;
-       $self->failure($err) if $err;
+       return $self->failure($err) if $err;
        $self->quit(0);
     };
 
@@ -938,6 +939,7 @@ sub usage {
 
 Usage: amvault [-o configoption...] [-q] [--quiet] [-n] [--dry-run]
           [--fulls-only] [--export] [--src-timestamp src-timestamp]
+          [--exact-match]
           --label-template label-template --dst-changer dst-changer
           [--autolabel autolabel-arg...]
           config
@@ -973,6 +975,7 @@ my @config_overrides_opts;
 my $opt_quiet = 0;
 my $opt_dry_run = 0;
 my $opt_fulls_only = 0;
+my $opt_exact_match = 0;
 my $opt_export = 0;
 my $opt_autolabel = {};
 my $opt_autolabel_seen = 0;
@@ -1016,6 +1019,7 @@ GetOptions(
     'q|quiet' => \$opt_quiet,
     'n|dry-run' => \$opt_dry_run,
     'fulls-only' => \$opt_fulls_only,
+    'exact-match' => \$opt_exact_match,
     'export' => \$opt_export,
     'label-template=s' => \&set_label_template,
     'autolabel=s' => \&add_autolabel,
@@ -1029,7 +1033,9 @@ $opt_autolabel->{'empty'} = 1 unless $opt_autolabel_seen;
 usage("not enough arguments") unless (@ARGV >= 1);
 
 my $config_name = shift @ARGV;
-my @opt_dumpspecs = parse_dumpspecs(\@ARGV, $CMDLINE_PARSE_DATESTAMP|$CMDLINE_PARSE_LEVEL)
+my $cmd_flags = $CMDLINE_PARSE_DATESTAMP|$CMDLINE_PARSE_LEVEL;
+$cmd_flags |= $CMDLINE_EXACT_MATCH if $opt_exact_match;
+my @opt_dumpspecs = parse_dumpspecs(\@ARGV, $cmd_flags)
     if (@ARGV);
 
 usage("no --label-template given") unless $opt_autolabel->{'template'};