package modules::parameters; # $Id$ use diagnostics; use strict; #-###################################################################################### #- misc imports #-###################################################################################### use common; use modules; sub parameters { my ($module) = @_; if (!$::isStandalone && !$::testing) { ($module) = modules::extract_modules('/tmp', $module); } my @parameters; foreach (common::join_lines(run_program::get_stdout('modinfo', '-p', $module))) { 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 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 ? 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; } 1; ion> Mageia Installer and base platform for many utilitiesThierry Vignaud [tv]
summaryrefslogtreecommitdiffstats
path: root/images
diff options
context:
space:
mode:
authorAnne Nicolas <ennael@mageia.org>2011-02-09 20:24:08 +0000
committerAnne Nicolas <ennael@mageia.org>2011-02-09 20:24:08 +0000
commit21186943447763ca00c75855813deb9b54715d47 (patch)
treea7a5c19409429db3190a2ce5aae52a64bd510cc1 /images
parent9dee3e48ed81a34bd528db1e85d6eaa2f3b524fa (diff)
downloaddrakx-21186943447763ca00c75855813deb9b54715d47.tar
drakx-21186943447763ca00c75855813deb9b54715d47.tar.gz
drakx-21186943447763ca00c75855813deb9b54715d47.tar.bz2
drakx-21186943447763ca00c75855813deb9b54715d47.tar.xz
drakx-21186943447763ca00c75855813deb9b54715d47.zip
use gfxboot.c32 instead of gfxboot.com as gfxboot is now handled as a module in syslinux