# 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
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;
}
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