X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=perl%2FAmanda%2FChanger.pm;fp=perl%2FAmanda%2FChanger.pm;h=419c1a0d510755522595522c3e48d288f68d3b1c;hb=949b8910a5e23c4285d0b1aedacfc82a14dc97a5;hp=ddb7f660a5ef559a2b459892587d57752cdfa508;hpb=c6f0a88c567f8536c498f554285aed1f8150da18;p=debian%2Famanda diff --git a/perl/Amanda/Changer.pm b/perl/Amanda/Changer.pm index ddb7f66..419c1a0 100644 --- a/perl/Amanda/Changer.pm +++ b/perl/Amanda/Changer.pm @@ -1,4 +1,4 @@ -# Copyright (c) 2007,2008,2009,2010 Zmanda, Inc. All Rights Reserved. +# Copyright (c) 2007-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 @@ -1253,15 +1253,19 @@ sub make_new_tape_label { my $tl = $self->{'tapelist'}; die ("make_new_tape_label: no tapelist") if !$tl; - return undef if !defined $self->{'autolabel'}->{'template'}; - return undef if !defined $self->{'labelstr'}; + if (!defined $self->{'autolabel'}) { + return (undef, "autolabel not set"); + } + if (!defined $self->{'autolabel'}->{'template'}) { + return (undef, "template is not set, you must set autolabel"); + } + if (!defined $self->{'labelstr'}) { + return (undef, "labelstr not set"); + } my $template = $self->{'autolabel'}->{'template'}; my $labelstr = $self->{'labelstr'}; my $slot_digit = 1; - if (!$template) { - return (undef, "template is not set, you must set autolabel"); - } $template =~ s/\$\$/SUBSTITUTE_DOLLAR/g; $template =~ s/\$b/SUBSTITUTE_BARCODE/g; $template =~ s/\$m/SUBSTITUTE_META/g;