summaryrefslogtreecommitdiffstats
path: root/perl-install/install_any.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/install_any.pm')
-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);
+ }
}