X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=perl%2FAmanda%2FScanInventory.pm;fp=perl%2FAmanda%2FScanInventory.pm;h=f5d4d7b12a95601ed05a43f8df9df0d799907710;hb=949b8910a5e23c4285d0b1aedacfc82a14dc97a5;hp=d47f67510a89251635318189451ce261593da63f;hpb=c6f0a88c567f8536c498f554285aed1f8150da18;p=debian%2Famanda diff --git a/perl/Amanda/ScanInventory.pm b/perl/Amanda/ScanInventory.pm index d47f675..f5d4d7b 100644 --- a/perl/Amanda/ScanInventory.pm +++ b/perl/Amanda/ScanInventory.pm @@ -1,4 +1,4 @@ -# Copyright (c) 2010 Zmanda, Inc. All Rights Reserved. +# 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 @@ -264,10 +264,12 @@ sub _scan { $res->{device}->status == $DEVICE_STATUS_SUCCESS) { $label = $res->{device}->volume_label; } + my $relabeled = !defined($label) || $label !~ /$self->{'labelstr'}/; $self->_user_msg(slot_result => 1, slot => $slot_scanned, label => $label, err => $err, + relabeled => $relabeled, res => $res); if ($res) { my $f_type; @@ -500,7 +502,7 @@ sub _scan { return $result_cb->($err, $res); } $label = $res->{'device'}->volume_label; - if (!defined $label) { + if (!defined($label) || $label !~ /$self->{'labelstr'}/) { $res->get_meta_label(finished_cb => $steps->{'got_meta_label'}); return; } @@ -567,12 +569,13 @@ sub volume_is_labelable { err => $sl->{'device_error'}, slot => $slot); return 0; - } elsif ($dev_status & $DEVICE_STATUS_SUCCESS and + } elsif ($dev_status == $DEVICE_STATUS_SUCCESS and $f_type == $Amanda::Header::F_TAPESTART and $label !~ /$self->{'labelstr'}/) { if (!$autolabel->{'other_config'}) { $self->_user_msg(slot_result => 1, - other_config => 1, + label => $label, + does_not_match_labelstr => 1, slot => $slot); return 0; }