summaryrefslogtreecommitdiffstats
path: root/perl-install/modules/parameters.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2007-04-25 12:26:16 +0000
committerPascal Rigaux <pixel@mandriva.com>2007-04-25 12:26:16 +0000
commit126777bc019a54afb4ec51299f2cf9d2841698aa (patch)
tree97f76e571902ead55ba138f1156a4b4f00b9b779 /perl-install/modules/parameters.pm
parentf1f67448efc714873378dfeb8279fae68054a90a (diff)
downloaddrakx-backup-do-not-use-126777bc019a54afb4ec51299f2cf9d2841698aa.tar
drakx-backup-do-not-use-126777bc019a54afb4ec51299f2cf9d2841698aa.tar.gz
drakx-backup-do-not-use-126777bc019a54afb4ec51299f2cf9d2841698aa.tar.bz2
drakx-backup-do-not-use-126777bc019a54afb4ec51299f2cf9d2841698aa.tar.xz
drakx-backup-do-not-use-126777bc019a54afb4ec51299f2cf9d2841698aa.zip
re-sync after the big svn loss
Diffstat (limited to 'perl-install/modules/parameters.pm')
-rw-r--r--perl-install/modules/parameters.pm41
1 files changed, 4 insertions, 37 deletions
diff --git a/perl-install/modules/parameters.pm b/perl-install/modules/parameters.pm
index fa8fcfae7..2af5ce951 100644
--- a/perl-install/modules/parameters.pm
+++ b/perl-install/modules/parameters.pm
@@ -17,44 +17,11 @@ sub parameters {
($module) = modules::extract_modules('/tmp', $module);
}
- my @parameters;
- foreach (common::join_lines(run_program::get_stdout('modinfo', '-p', $module))) {
+ map {
chomp;
- next if /^warning:/;
- (my $name, $_) = /(\w+)(?::|\s+)(.*)/s or warn "modules::parameters::get_options_name($module): unknown line\n";
- if (c::kernel_version() =~ /^\Q2.6/) {
- push @parameters, [ $name, '', $_ ];
- next;
- }
-
- my $c_types = 'int|string|short|byte|char|long';
- my ($is_a_number, $description, $min, $max) = (0, '', 1, 1);
- if (/^($c_types) array \(min = (\d+), max = (\d+)\),?\s*(.*)/s) {
- $_ = $4;
- #- seems like "char" are buggy entries
- ($is_a_number, $min, $max) = ($1 ne 'string', $2, $3) if $1 ne 'char';
- } elsif (/^($c_types),?\s*(.*)/s) {
- $_ = $2;
- #- here "char" really are size-limited strings, modinfo does not display the size limit (but since we do not care about it, it does not matter :)
- $is_a_number = $1 ne 'string' if $1 ne 'char';
- } else {
- #- for things like "no format character" or "unknown format character"
- }
- if (/^description "(.*)",?\s*/s) {
- ($description, $_) = ($1, $2);
- }
- #- print "STILL HAVE ($_)\n" if $_;
-
- my $format = $min == 1 && $max == 1 ?
- ($is_a_number ? N("a number") : '') :
- $min == $max ?
- ($is_a_number ? N("%d comma separated numbers", $min) : N("%d comma separated strings", $min)) :
- $min == 1 ?
- ($is_a_number ? N("comma separated numbers") : N("comma separated strings")) :
- ''; #- too weird and buggy, do not display it
- push @parameters, [ $name, $format, $description ];
- }
- @parameters;
+ (my $name, $_) = /(\w+):(.*)/s or warn "modules::parameters::parameters($module): unknown line\n";
+ [ $name, $_ ];
+ } common::join_lines(run_program::get_stdout('modinfo', '-p', $module));
}
1;