X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=perl%2FAmanda%2FTapelist.swg;fp=perl%2FAmanda%2FTapelist.swg;h=dff9b86177670c29bc87d27f932f68c1eb925de7;hb=d28952249e392eb31bc8eecc53f6c477f30c617b;hp=0ce1987bb8e94e4ec189a154180649ed1f6662a3;hpb=949b8910a5e23c4285d0b1aedacfc82a14dc97a5;p=debian%2Famanda diff --git a/perl/Amanda/Tapelist.swg b/perl/Amanda/Tapelist.swg index 0ce1987..dff9b86 100644 --- a/perl/Amanda/Tapelist.swg +++ b/perl/Amanda/Tapelist.swg @@ -1,9 +1,10 @@ /* * 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 @@ -228,12 +229,14 @@ sub _read_tapelist { open(my $fh, "<", $self->{'filename'}) or return $self; while (my $line = <$fh>) { my ($datestamp, $label, $reuse, $barcode, $meta, $blocksize, $comment) - = $line =~ m/^([0-9]*)\s([^\s]*)\s(reuse|no-reuse)\s*(?:BARCODE:([^\s]*))?\s*(?:META:([^\s]*))?\s*(?:BLOCKSIZE:([^\s]*))?\s*(?:\#(.*))?$/mx; - next if !defined $datestamp; # silently filter out bogus lines + = $line =~ m/^([0-9]+)\s*([^\s]*)\s*(?:(reuse|no-reuse))?\s*(?:BARCODE:([^\s]*))?\s*(?:META:([^\s]*))?\s*(?:BLOCKSIZE:([^\s]*))?\s*(?:\#(.*))?$/mx; + if (!defined $datestamp) { + Amanda::Debug::critical("Bogus line in the tapelist ($self->{'filename'}) file: $line"); + } push @tles, { 'datestamp' => $datestamp, 'label' => $label, - 'reuse' => ($reuse eq 'reuse'), + 'reuse' => (!defined $reuse || $reuse eq 'reuse'), 'barcode' => $barcode, 'meta' => $meta, 'blocksize' => $blocksize,