diff options
author | Mystery Man <unknown@mandriva.org> | 2002-07-23 11:21:56 +0000 |
---|---|---|
committer | Mystery Man <unknown@mandriva.org> | 2002-07-23 11:21:56 +0000 |
commit | c20b84a8b572951b48049234f632f4f1dd7c978f (patch) | |
tree | 492e9ef624cee574ecd82c836aeb4b0b05915e6b /perl-install/modparm.pm | |
parent | 127a73d935d78af53d3dadd05d4636f6b717976d (diff) | |
download | drakx-c20b84a8b572951b48049234f632f4f1dd7c978f.tar drakx-c20b84a8b572951b48049234f632f4f1dd7c978f.tar.gz drakx-c20b84a8b572951b48049234f632f4f1dd7c978f.tar.bz2 drakx-c20b84a8b572951b48049234f632f4f1dd7c978f.tar.xz drakx-c20b84a8b572951b48049234f632f4f1dd7c978f.zip |
This commit was manufactured by cvs2svn to create tag 'V1_1_8_12mdk'.V1_1_8_12mdk
Diffstat (limited to 'perl-install/modparm.pm')
-rw-r--r-- | perl-install/modparm.pm | 63 |
1 files changed, 0 insertions, 63 deletions
diff --git a/perl-install/modparm.pm b/perl-install/modparm.pm deleted file mode 100644 index ee5fd46ab..000000000 --- a/perl-install/modparm.pm +++ /dev/null @@ -1,63 +0,0 @@ -package modparm; # $Id$ - -use diagnostics; -use strict; - -#-###################################################################################### -#- misc imports -#-###################################################################################### -use common; -use modules; - - -sub parameters { - my ($module) = @_; - - my $modinfo = '/sbin/modinfo'; - -x $modinfo or $modinfo = '/usr/bin/modinfo'; - -x $modinfo or die _('modinfo is not available'); - - if (!$::isStandalone && !$::testing) { - modules::extract_modules('/tmp', $module); - $module = "/tmp/$module.o"; - } - - my @parameters; - foreach (common::join_lines(`$modinfo -p $module`)) { - chomp; - next if /^warning:/; - (my $name, $_) = /(\S+)\s+(.*)/s or warn "modparm::get_options_name($module): unknown line\n"; - - 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 doesn't display the size limit (but since we don't care about it, it doesn't 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 ? _("a number") : '') : - $min == $max ? - ($is_a_number ? _("%d comma separated numbers", $min) : _("%d comma separated strings", $min)) : - $min == 1 ? - ($is_a_number ? _("comma separated numbers") : _("comma separated strings")) : - ''; #- to weird and buggy, do not display it - - push @parameters, [ $format ? "$name ($format)" : $name, $description ]; - } - @parameters; -} - -1; |