From 65ac724a8fd1e1e554305562ecff102bfa2dc0b6 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Wed, 4 Apr 2001 17:25:08 +0000 Subject: (kernelVersion): cleanup --- perl-install/install_any.pm | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'perl-install') 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); + } } -- cgit v1.2.1