diff options
author | Mystery Man <unknown@mandriva.org> | 2001-06-11 13:49:39 +0000 |
---|---|---|
committer | Mystery Man <unknown@mandriva.org> | 2001-06-11 13:49:39 +0000 |
commit | 16bde8b3d7027aba56051fbf557b7735eb2ee6aa (patch) | |
tree | 0d8736af65eea4a83b8445ee8e2a6d0c951aea67 /perl-install/modparm.pm | |
parent | 0a121a8ecd6de894c14d60daf9da2022ec47405c (diff) | |
download | drakx-topic/rp-pppoe.tar drakx-topic/rp-pppoe.tar.gz drakx-topic/rp-pppoe.tar.bz2 drakx-topic/rp-pppoe.tar.xz drakx-topic/rp-pppoe.zip |
This commit was manufactured by cvs2svn to create branch 'rp-pppoe'.topic/rp-pppoe
Diffstat (limited to 'perl-install/modparm.pm')
-rw-r--r-- | perl-install/modparm.pm | 60 |
1 files changed, 0 insertions, 60 deletions
diff --git a/perl-install/modparm.pm b/perl-install/modparm.pm deleted file mode 100644 index b6aee8905..000000000 --- a/perl-install/modparm.pm +++ /dev/null @@ -1,60 +0,0 @@ -package modparm; # $Id$ - -use diagnostics; -use strict; - -#-###################################################################################### -#- misc imports -#-###################################################################################### -use common qw(:common :functional); -use log; - - - -#-###################################################################################### -#- Functions -#-###################################################################################### -sub read_modparm_file { - my $file = -e "modparm.lst" ? "modparm.lst" : "$ENV{SHARE_PATH}/modparm.lst"; - my @line; - - my %modparm_hash; - local *F; open F, $file or log::l("missing $file: $!"), return; - local $_; - while (<F>) { - chomp; - @line = split ':'; - - $modparm_hash{$line[0]}{$line[1]} = { - type => $line[2], - default => $line[3], - desc => $line [4], - }; - } - \%modparm_hash; -} - -sub get_options_result($@) { - my ($module, @value) = @_; - my $modparm_hash = modparm::read_modparm_file; - - mapn { - my ($a, $b) = @_; - $a ? "$b=$a" : () - } \@value, [ keys %{$modparm_hash->{$module}} ]; -} - -sub get_options_name($) { - my ($module) = @_; - my @names; - my $modparm_hash = modparm::read_modparm_file; - - while (my ($k, $v) = each %{$modparm_hash->{$module} || {}}) { - my $opttype = $v->{type}; - my $default = $v->{default}; - push @names, "$k ($v->{type})" . (defined($v->{default}) && "[$v->{default}]"); - } - @names; -} - -1; |