/*
- * 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
sub add_tapelabel {
my $self = shift;
- my ($datestamp, $label, $comment, $reuse, $meta, $barcode) = @_;
+ my ($datestamp, $label, $comment, $reuse, $meta, $barcode, $blocksize) = @_;
$reuse = 1 if !defined $reuse;
# prepend this (presumably new) volume to the beginning of the list
'reuse' => $reuse,
'barcode' => $barcode,
'meta' => $meta,
+ 'blocksize' => $blocksize,
'comment' => $comment,
};
my $tles = $self->{'tles'};
my $reuse = $tle->{'reuse'} ? 'reuse' : 'no-reuse';
my $barcode = (defined $tle->{'barcode'})? (" BARCODE:" . $tle->{'barcode'}) : '';
my $meta = (defined $tle->{'meta'})? (" META:" . $tle->{'meta'}) : '';
+ my $blocksize = (defined $tle->{'blocksize'})? (" BLOCKSIZE:" . $tle->{'blocksize'}) : '';
my $comment = (defined $tle->{'comment'})? (" #" . $tle->{'comment'}) : '';
- $result &&= print $fhn "$datestamp $label $reuse$barcode$meta$comment\n";
+ $result &&= print $fhn "$datestamp $label $reuse$barcode$meta$blocksize$comment\n";
}
my $result_close = close($fhn);
$result &&= $result_close;
my @tles;
open(my $fh, "<", $self->{'filename'}) or return $self;
while (my $line = <$fh>) {
- my ($datestamp, $label, $reuse, $barcode, $meta, $comment)
- = $line =~ m/^([0-9]*)\s([^\s]*)\s(reuse|no-reuse)\s*(?:BARCODE:([^\s]*))?\s*(?:META:([^\s]*))?\s*(?:\#(.*))?$/mx;
+ 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
push @tles, {
'datestamp' => $datestamp,
'reuse' => ($reuse eq 'reuse'),
'barcode' => $barcode,
'meta' => $meta,
+ 'blocksize' => $blocksize,
'comment' => $comment,
};
}
%}
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 */