diff options
author | Francois Pons <fpons@mandriva.com> | 2002-08-20 14:54:33 +0000 |
---|---|---|
committer | Francois Pons <fpons@mandriva.com> | 2002-08-20 14:54:33 +0000 |
commit | 2e63b0cb0921be02a758b503ade2657139ab3b4f (patch) | |
tree | ad0a9f1553bf3ec9def20fa461bfe5910a483031 | |
parent | 1498055dffc6e1b440d8b61b32cc0cbf32f61ad3 (diff) | |
download | drakx-2e63b0cb0921be02a758b503ade2657139ab3b4f.tar drakx-2e63b0cb0921be02a758b503ade2657139ab3b4f.tar.gz drakx-2e63b0cb0921be02a758b503ade2657139ab3b4f.tar.bz2 drakx-2e63b0cb0921be02a758b503ade2657139ab3b4f.tar.xz drakx-2e63b0cb0921be02a758b503ade2657139ab3b4f.zip |
added bestKernelPackage.
-rw-r--r-- | perl-install/pkgs.pm | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/perl-install/pkgs.pm b/perl-install/pkgs.pm index 76a5fde39..c6c3152c7 100644 --- a/perl-install/pkgs.pm +++ b/perl-install/pkgs.pm @@ -163,6 +163,18 @@ sub packageById { my $pkg = $packages->{depslist}[$id]; #- do not log as id unsupported are still in depslist. $pkg->is_arch_compat && $pkg; } + +sub bestKernelPackage { + my ($packages) = @_; + my $best; + + foreach ($packages->{provides}{kernel}) { + my $pkg = $packages->{depslist}[$_] or next; + $pkg->name =~ /kernel-\d/ or next; + !$best || $pkg->compare_pkg($best) > 0 and $best = $pkg; + } +} + sub packagesOfMedium { my ($packages, $medium) = @_; $medium->{start} <= $medium->{end} ? @{$packages->{depslist}}[$medium->{start} .. $medium->{end}] : (); |