summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authordamien <damien@mandriva.com>2002-02-25 18:55:19 +0000
committerdamien <damien@mandriva.com>2002-02-25 18:55:19 +0000
commit3072ecb88c8058c1414c19f360524cb74e7d9cb3 (patch)
tree9d9dd8f6e269d2bf384eb03d775f701c6c7770b1 /perl-install
parent2f752b3d465e2d9338da2d266bb0ecefc08b2ba8 (diff)
downloaddrakx-3072ecb88c8058c1414c19f360524cb74e7d9cb3.tar
drakx-3072ecb88c8058c1414c19f360524cb74e7d9cb3.tar.gz
drakx-3072ecb88c8058c1414c19f360524cb74e7d9cb3.tar.bz2
drakx-3072ecb88c8058c1414c19f360524cb74e7d9cb3.tar.xz
drakx-3072ecb88c8058c1414c19f360524cb74e7d9cb3.zip
corrected modules parameters functions
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/any.pm7
-rw-r--r--perl-install/modparm.pm26
2 files changed, 21 insertions, 12 deletions
diff --git a/perl-install/any.pm b/perl-install/any.pm
index 61bf7ed55..f7a6ff44e 100644
--- a/perl-install/any.pm
+++ b/perl-install/any.pm
@@ -702,9 +702,10 @@ not cause any damage.", $l),
[ __("Autoprobe"), __("Specify options") ], "Autoprobe") ne "Autoprobe") {
ASK:
if (@names >= 0) {
- my @l = $in->ask_from_entries('',
-_("You may now provide its options to module %s.", $l),
- \@names) or return;
+
+ my @args = map { my $i = ''; /TOOLTIP=>(.*)/; my $t = $1; s/TOOLTIP=>.*//;print "tooltip : $t\n"; { label => $_, val => \$i, help => $t} } @names;
+ my @l = $in->ask_from('', _("You may now provide its options to module %s.\nNote that any addresse should be entered with the prefix 0x like '0x123'", $l), \@args) ? map { ${$_->{val}} } @args : undef or return;
+
@options = modparm::get_options_result($m, @l);
} else {
@options = split ' ',
diff --git a/perl-install/modparm.pm b/perl-install/modparm.pm
index f1c81b0dd..a52b98710 100644
--- a/perl-install/modparm.pm
+++ b/perl-install/modparm.pm
@@ -14,7 +14,7 @@ sub get_options_result($@) {
my ($module, @value) = @_;
mapn {
my ($a, $b) = @_;
- $b =~ s/^(\w).*/$1/;
+ $b =~ s/^(\w+).*/$1/;
$a ? "$b=$a" : ();
} \@value, [get_options_name($module)];
}
@@ -24,19 +24,27 @@ sub get_options_name($) {
my @names;
my @line = `/sbin/modinfo -p $module`;
+ print "yop : @line \n";
foreach (@line) {
chomp;
- s/int/i/;
- s/string/string/;
- s/short/h/;
- s/long/l/;
- s/(\S) array \(min = (\d+), max = (\d+)\)/$2-$3$1/;
- s/(\d)-\1i/$1i/;
+ s/int/: (integer/;
+ s/string/: (string/;
+ my ($f, $g) = /array \(min = (\d+), max = (\d+)\)/;
+ my $c;
+ if ($f == 1 && $g == 1) {
+ $c = _('1 character)');
+ } else {
+ $c = _("$f-$g %s)", 'characters');
+ }
+ s/array \(min = \d+, max = \d+\)/$c/;
if (/parm:\s+(.+)/) {
- my ($name, $type) = split '\s', $1;
- push @names, "$name ($type)";
+ local $_ = $1;
+ s/\s+/ /;
+ s/, description /TOOLTIP=>/;
+ push @names, $_;
}
}
+ print "yop : @names \n";
@names;
}