summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2001-04-04 17:25:08 +0000
committerPascal Rigaux <pixel@mandriva.com>2001-04-04 17:25:08 +0000
commit65ac724a8fd1e1e554305562ecff102bfa2dc0b6 (patch)
tree1e6914bb6237783b53bfc82c4e628dad02ca65e0
parent20ed5cd56bb433cba4b19e41d6baea4311b79eb2 (diff)
downloaddrakx-65ac724a8fd1e1e554305562ecff102bfa2dc0b6.tar
drakx-65ac724a8fd1e1e554305562ecff102bfa2dc0b6.tar.gz
drakx-65ac724a8fd1e1e554305562ecff102bfa2dc0b6.tar.bz2
drakx-65ac724a8fd1e1e554305562ecff102bfa2dc0b6.tar.xz
drakx-65ac724a8fd1e1e554305562ecff102bfa2dc0b6.zip
(kernelVersion): cleanup
-rw-r--r--perl-install/install_any.pm20
1 files changed, 10 insertions, 10 deletions
diff --git a/perl-install/install_any.pm b/perl-install/install_any.pm
index 67d2a2dc5..f946806ab 100644
--- a/perl-install/install_any.pm
+++ b/perl-install/install_any.pm
@@ -197,17 +197,17 @@ sub clean_postinstall_rpms() {
#-######################################################################################
sub kernelVersion {
my ($o) = @_;
- if(arch() !~ /ppc/) {
- local $_ = readlink("$::o->{prefix}/boot/vmlinuz") and return first(/vmlinuz-(.*mdk)/);
+ if (my $link = (arch() !~ /ppc/) ?
+ readlink("$o->{prefix}/boot/vmlinuz") :
+ readlink("$o->{prefix}/boot/vmlinux")) {
+ $link =~ first(/-(.*mdk)/);
} else {
- local $_ = readlink("$::o->{prefix}/boot/vmlinux") and return first(/vmlinux-(.*mdk)/);
- }
-
- require pkgs;
- my $kpkgname = "kernel";
- $kpkgname = "kernel22" if arch() =~ /ppc/; #- still using 2.2 for PPC
- my $p = pkgs::packageByName($o->{packages}, "$kpkgname") or die "I couldn't find the kernel package!";
- pkgs::packageVersion($p) . "-" . pkgs::packageRelease($p);
+ require pkgs;
+ my $p = pkgs::packageByName($o->{packages}, "kernel");
+ $p ||= pkgs::packageByName($o->{packages}, "kernel22");
+ $p or die "I couldn't find the kernel package!";
+ pkgs::packageVersion($p) . "-" . pkgs::packageRelease($p);
+ }
}