summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/MDV/Distribconf/Build.pm24
1 files changed, 20 insertions, 4 deletions
diff --git a/lib/MDV/Distribconf/Build.pm b/lib/MDV/Distribconf/Build.pm
index 1d5cb4c..007a6ef 100644
--- a/lib/MDV/Distribconf/Build.pm
+++ b/lib/MDV/Distribconf/Build.pm
@@ -16,7 +16,7 @@
#
# $Id$
-package Distribconf::Build;
+package MDV::Distribconf::Build;
=head1 NAME
@@ -30,10 +30,10 @@ Distribconf::Build - Extension to Distribconf to build configuration
use strict;
use warnings;
-use Distribconf;
+use MDV::Distribconf;
our @ISA = qw(Distribconf);
-our $VERSION = $Distribconf::VERSION;
+our $VERSION = $MDV::Distribconf::VERSION;
=item Distribconf::Build->new($root_of_distrib)
@@ -63,12 +63,28 @@ sub setvalue {
return;
};
$distrib->{cfg}->newval($media, $var, $val)
- or die "Can't set value [$var=$val] for $media\n";
+ or warn "Can't set value [$var=$val] for $media\n";
} else {
$distrib->{cfg}->AddSection($media);
}
}
+=item $distrib->delvalue($media, $var)
+
+Delete $var parameter from $media. If $var is not specified, the media is
+is deleted. If $media is not specified, $var is remove from global settings.
+
+=cut
+
+sub delvalue {
+ my ($distrib, $media, $var) = @_;
+ if ($var) {
+ $distrib->{cfg}->delval($media, $var);
+ } else {
+ $distrib->{cfg}->DeleteSection($media);
+ }
+}
+
=item $distrib->write_hdlists($hdlists)
Writes the F<hdlists> file to C<$hdlists>, or if no parameter is given, in