Imported Upstream version 3.3.1
[debian/amanda] / perl / Amanda / Tapelist.pm
index b028127ad60882c05382a0745a2f6bd1e10a5737..26803117b58f9eed59adaaa4dde491af47fdf765 100644 (file)
@@ -1,5 +1,5 @@
 # This file was automatically generated by SWIG (http://www.swig.org).
-# Version 1.3.39
+# Version 2.0.4
 #
 # Do not make changes to this file unless you know what you are doing--modify
 # the SWIG interface file instead.
@@ -309,7 +309,7 @@ sub remove_tapelabel {
 
 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
@@ -319,6 +319,7 @@ sub add_tapelabel {
         'reuse'     => $reuse,
         'barcode'   => $barcode,
         'meta'      => $meta,
+        'blocksize' => $blocksize,
         'comment'   => $comment,
     };
     my $tles = $self->{'tles'};
@@ -357,8 +358,9 @@ sub write {
        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;
@@ -410,8 +412,8 @@ sub _read_tapelist {
     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,
@@ -419,6 +421,7 @@ sub _read_tapelist {
            'reuse' => ($reuse eq 'reuse'),
            'barcode' => $barcode,
            'meta' => $meta,
+           'blocksize' => $blocksize,
            'comment' => $comment,
        };
     }