X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=installcheck%2FInstallcheck%2FConfig.pm;h=d9b4a7df87c979936cac502ba2ec2aeb0f4eb217;hb=691567b16c13087b31ee4c2b6d038e57872fae82;hp=2fc3918677f6996d0d2171a67c2ea133142b15ce;hpb=fd48f3e498442f0cbff5f3606c7c403d0566150e;p=debian%2Famanda diff --git a/installcheck/Installcheck/Config.pm b/installcheck/Installcheck/Config.pm index 2fc3918..d9b4a7d 100644 --- a/installcheck/Installcheck/Config.pm +++ b/installcheck/Installcheck/Config.pm @@ -1,9 +1,10 @@ # vim:ft=perl -# Copyright (c) 2008,2009 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 @@ -203,6 +204,8 @@ sub remove_param { =item C =item C =item C +=item C +=item C 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 +281,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 arbitrary text to the config file. @@ -371,9 +386,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 +412,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); } @@ -413,8 +436,10 @@ sub _write_amanda_conf_subsection { $value = shift @values; if ($param eq "inherit") { print $amanda_conf "$value\n"; - } else { + } elsif (defined $value) { print $amanda_conf "$param $value\n"; + } else { + print $amanda_conf "$param\n"; } } print $amanda_conf "}\n";