X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=perl%2FAmanda%2FTaper%2FScan%2Flexical.pm;fp=perl%2FAmanda%2FTaper%2FScan%2Flexical.pm;h=dfd2bab0cffd244431ad2d4f1c4dff9fc8b03e95;hb=d28952249e392eb31bc8eecc53f6c477f30c617b;hp=44c2b0e1bcf2d0e3ea257eb76f3323ed667106e7;hpb=949b8910a5e23c4285d0b1aedacfc82a14dc97a5;p=debian%2Famanda diff --git a/perl/Amanda/Taper/Scan/lexical.pm b/perl/Amanda/Taper/Scan/lexical.pm index 44c2b0e..dfd2bab 100644 --- a/perl/Amanda/Taper/Scan/lexical.pm +++ b/perl/Amanda/Taper/Scan/lexical.pm @@ -1,8 +1,9 @@ # Copyright (c) 2010-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 @@ -149,17 +150,25 @@ sub analyze { push @reusable, $sl; } else { my $vol_tle = $self->{'tapelist'}->lookup_tapelabel($sl->{'label'}); - if ($vol_tle) { + if ($vol_tle && $sl->{'label'} =~ /$self->{'labelstr'}/) { if ($vol_tle->{'datestamp'} eq '0') { push @new_labeled, $sl; } } elsif ($self->volume_is_labelable($sl)) { + $sl->{'label'} = $self->{'chg'}->make_new_tape_label( + barcode => $sl->{'barcode'}, + slot => $sl->{'slot'}, + meta => $sl->{'meta'}); $first_new_volume = $sl if !$first_new_volume; $new_volume = $sl if $current && !$new_volume; push @new_volume, $sl; } } } elsif ($self->volume_is_labelable($sl)) { + $sl->{'label'} = $self->{'chg'}->make_new_tape_label( + barcode => $sl->{'barcode'}, + slot => $sl->{'slot'}, + meta => $sl->{'meta'}); $first_new_volume = $sl if !$first_new_volume; $new_volume = $sl if $current && !$new_volume; push @new_volume, $sl; @@ -203,10 +212,6 @@ sub analyze { } for my $sl (@new_volume) { - $sl->{'label'} = $self->{'chg'}->make_new_tape_label( - barcode => $sl->{'barcode'}, - slot => $sl->{'slot'}, - meta => $sl->{'meta'}); $new_volume = $sl if defined $last_label and $new_volume->{'label'} ne $sl->{'label'} and (($sl->{'label'} gt $last_label and