aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.com>2008-04-02 19:42:42 +0000
committerOlivier Blin <oblin@mandriva.com>2008-04-02 19:42:42 +0000
commit463bd1d6508d073aae7850a30863e06f05e15d5f (patch)
tree596cf2dcda8b8f536a0210385733a4e4dce52c39 /lib
parentd2c250d65422521a49192102566ecc42da3066dd (diff)
downloadiurt-463bd1d6508d073aae7850a30863e06f05e15d5f.tar
iurt-463bd1d6508d073aae7850a30863e06f05e15d5f.tar.gz
iurt-463bd1d6508d073aae7850a30863e06f05e15d5f.tar.bz2
iurt-463bd1d6508d073aae7850a30863e06f05e15d5f.tar.xz
iurt-463bd1d6508d073aae7850a30863e06f05e15d5f.zip
factorize (and avoid printing harmless error messages)
Diffstat (limited to 'lib')
-rw-r--r--lib/Iurt/DKMS.pm27
1 files changed, 12 insertions, 15 deletions
diff --git a/lib/Iurt/DKMS.pm b/lib/Iurt/DKMS.pm
index dd5a017..a7993ef 100644
--- a/lib/Iurt/DKMS.pm
+++ b/lib/Iurt/DKMS.pm
@@ -122,21 +122,18 @@ sub search_dkms {
plog("checking $realmodule-kernel-$modulesdir-$realversion");
next if $cache->{dkms}{"$realmodule-kernel-$modulesdir-$realversion"} && !$run->{ignore_failure};
if (!$modules{$realmodule}{$realversion}{$modulesdir}) {
- my ($name, $v) = $kernel =~ /^([^-]+)-.*-(2\..*)/;
- my $source = "$name-$v";
- if (!$kernel_source{$source}) {
- my ($name) = $kernel =~ /(2\..*)/;
- plog('ERR', "ERROR: no source for kernel $kernel (source $source), testing $name");
- $source = $name;
- if (!$kernel_source{$source}) {
- my $name = $kernel;
- plog('ERR', "ERROR: no source for kernel $kernel (source $source), testing $name");
- $source = $name;
- if (!$kernel_source{$source}) {
- plog('ERR', "ERROR: no source for kernel $kernel (source $source), ignoring");
- next;
- }
- }
+ my @choices;
+ if (my ($name, $v) = $kernel =~ /^([^-]+)-.*-(2\..*)/) {
+ push @choices, "$name-$v";
+ }
+ if (my ($name) = $kernel =~ /(2\..*)/) {
+ push @choices, $name;
+ }
+ push @choices, $kernel;
+ my $source = find { $kernel_source{$_} } @choices;
+ if (!$source) {
+ plog('ERR', "ERROR: no source for kernel $kernel (tried " . join(", ", @choices) . ")");
+ next;
}
plog("dkms module $module version $version should be compiled for kernel $kernel ($source)");
$nb++;