/*
- * Copyright (c) 2008, 2009, 2010 Zmanda, Inc. All Rights Reserved.
+ * 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
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,
%}
char *get_last_reusable_tape_label(int skip);
+%newobject list_new_tapes;
char *list_new_tapes(int nb);
/* C functions -- should be called *only* from within this module */