Imported Upstream version 3.3.0
[debian/amanda] / installcheck / Installcheck / Config.pm
index 2fc3918677f6996d0d2171a67c2ea133142b15ce..835bcf934f6372d543ef9a6919b97f56c4533e29 100644 (file)
@@ -203,6 +203,8 @@ sub remove_param {
 =item C<add_script($name, $values_arrayref)>
 =item C<add_device($name, $values_arrayref)>
 =item C<add_changer($name, $values_arrayref)>
+=item C<add_interactivity($name, $values_arrayref)>
+=item C<add_taperscan($name, $values_arrayref)>
 
 Add the given subsection to the configuration file, including all values in the
 arrayref.  The values should be specified as alternating key/value pairs.
@@ -278,6 +280,18 @@ sub add_changer {
     $self->_add_subsec("changers", $name, 1, $values);
 }
 
+sub add_interactivity {
+    my $self = shift;
+    my ($name, $values) = @_;
+    $self->_add_subsec("interactivities", $name, 1, $values);
+}
+
+sub add_taperscan {
+    my $self = shift;
+    my ($name, $values) = @_;
+    $self->_add_subsec("taperscans", $name, 1, $values);
+}
+
 =item C<add_text($text)>
 
 Add arbitrary text to the config file.
@@ -371,9 +385,14 @@ sub _write_amanda_conf {
     # write key/value pairs
     my @params = @{$self->{'params'}};
     my $saw_tapetype = 0;
+    my $taperscan;
     while (@params) {
        $param = shift @params;
        $value = shift @params;
+       if ($param eq 'taperscan') {
+           $taperscan = $value;
+           next;
+       }
        print $amanda_conf "$param $value\n";
        $saw_tapetype = 1 if ($param eq "tapetype");
     }
@@ -392,7 +411,10 @@ sub _write_amanda_conf {
     $self->_write_amanda_conf_subsection($amanda_conf, "holdingdisk", $self->{"holdingdisks"});
     $self->_write_amanda_conf_subsection($amanda_conf, "device", $self->{"devices"});
     $self->_write_amanda_conf_subsection($amanda_conf, "changer", $self->{"changers"});
+    $self->_write_amanda_conf_subsection($amanda_conf, "interactivity", $self->{"interactivities"});
+    $self->_write_amanda_conf_subsection($amanda_conf, "taperscan", $self->{"taperscans"});
     print $amanda_conf "\n", $self->{'text'}, "\n";
+    print $amanda_conf "taperscan $taperscan\n" if $taperscan;
 
     close($amanda_conf);
 }