summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorOlivier Thauvin <nanardon@mandriva.org>2005-10-09 18:05:15 +0000
committerOlivier Thauvin <nanardon@mandriva.org>2005-10-09 18:05:15 +0000
commitaac630cc7807f983a90818898c273cbe100de28d (patch)
tree63f2ba18275af02d08cd2a1a74d4d7ceabb9f0ae /lib
parent6a46f4994635ebafc90a9a7d5c49ada9bf40436f (diff)
downloadperl-MDV-Distribconf-aac630cc7807f983a90818898c273cbe100de28d.tar
perl-MDV-Distribconf-aac630cc7807f983a90818898c273cbe100de28d.tar.gz
perl-MDV-Distribconf-aac630cc7807f983a90818898c273cbe100de28d.tar.bz2
perl-MDV-Distribconf-aac630cc7807f983a90818898c273cbe100de28d.tar.xz
perl-MDV-Distribconf-aac630cc7807f983a90818898c273cbe100de28d.zip
- add delvalue()
Diffstat (limited to 'lib')
-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