summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2004-02-12 20:59:55 +0000
committerPascal Rigaux <pixel@mandriva.com>2004-02-12 20:59:55 +0000
commitf59baab5976948265cd839347cde693cb43a2c4a (patch)
tree34a9adb913c86cf3946d0af785e89a05828ab22d /perl-install
parent50bdbd03aeb42f3cc96b1aa9edeb53b549401bac (diff)
downloaddrakx-f59baab5976948265cd839347cde693cb43a2c4a.tar
drakx-f59baab5976948265cd839347cde693cb43a2c4a.tar.gz
drakx-f59baab5976948265cd839347cde693cb43a2c4a.tar.bz2
drakx-f59baab5976948265cd839347cde693cb43a2c4a.tar.xz
drakx-f59baab5976948265cd839347cde693cb43a2c4a.zip
change return type of pkgs::packages2kernels()
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/do_pkgs.pm5
-rw-r--r--perl-install/install_any.pm9
-rw-r--r--perl-install/pkgs.pm10
3 files changed, 11 insertions, 13 deletions
diff --git a/perl-install/do_pkgs.pm b/perl-install/do_pkgs.pm
index c8cf03b23..05dbdb289 100644
--- a/perl-install/do_pkgs.pm
+++ b/perl-install/do_pkgs.pm
@@ -63,9 +63,8 @@ sub check_kernel_module_packages {
if (!$o_ext_name || pkgs::packageByName($do->{o}{packages}, $o_ext_name)) {
my @rpms = map {
- my ($p, $ext, $version) = @$_;
- my $name = "$base_name$ext-$version";
- if ($p->flag_available && pkgs::packageByName($do->{o}{packages}, $name)) {
+ my $name = $base_name . $_->{ext} . '-' . $_->{version};
+ if ($_->{pkg}->flag_available && pkgs::packageByName($do->{o}{packages}, $name)) {
log::l("found kernel module packages $name");
$name;
} else {
diff --git a/perl-install/install_any.pm b/perl-install/install_any.pm
index a57a4d537..2b49f4df2 100644
--- a/perl-install/install_any.pm
+++ b/perl-install/install_any.pm
@@ -305,11 +305,10 @@ sub setPackages {
($o->{compssUsers}, $o->{compssUsersSorted}) = pkgs::readCompssUsers($o->{meta_class});
#- set kernel-2.4xxx in group LSB
- foreach (grep { $_->[1] eq '' && $_->[2] =~ /^\Q2.4/ } pkgs::packages2kernels($o->{packages})) {
- my $pkg = $_->[0];
- $pkg->rate and internal_error("package " . $pkg->name . " should not have a rate");
- $pkg->set_rate(5);
- $pkg->set_rflags('LSB');
+ foreach (grep { $_->{ext} eq '' && $_->{version} =~ /^\Q2.4/ } pkgs::packages2kernels($o->{packages})) {
+ $_->{pkg}->rate and internal_error("package " . $_->{pkg}->name . " should not have a rate");
+ $_->{pkg}->set_rate(5);
+ $_->{pkg}->set_rflags('LSB');
}
#- preselect default_packages and compssUsersChoices.
diff --git a/perl-install/pkgs.pm b/perl-install/pkgs.pm
index 1cf32fba7..b61755b8c 100644
--- a/perl-install/pkgs.pm
+++ b/perl-install/pkgs.pm
@@ -174,7 +174,7 @@ sub packages2kernels {
map {
my $pkg = $packages->{depslist}[$_];
if (my ($ext, $version) = analyse_kernel_name($pkg->name)) {
- [ $pkg, $ext, $version ];
+ { pkg => $pkg, ext => $ext, version => $version };
} else {
log::l("ERROR: unknown package " . $pkg->name . " providing kernel");
();
@@ -187,16 +187,16 @@ sub bestKernelPackage {
my @kernels = packages2kernels($packages) or internal_error('no kernel available');
my ($version_BOOT) = c::kernel_version() =~ /^(\d+\.\d+)/;
- if (my @l = grep { $_->[2] =~ /\Q$version_BOOT/ } @kernels) {
+ if (my @l = grep { $_->{version} =~ /\Q$version_BOOT/ } @kernels) {
#- favour versions corresponding to current BOOT version
@kernels = @l;
}
- if (my @l = grep { $_->[1] eq '' } @kernels) {
+ if (my @l = grep { $_->{ext} eq '' } @kernels) {
@kernels = @l;
}
- log::l("bestKernelPackage: " . join(' ', map { $_->[0]->name } @kernels) . (@kernels > 1 ? ' (choosing the first)' : ''));
- $kernels[0][0];
+ log::l("bestKernelPackage: " . join(' ', map { $_->{pkg}->name } @kernels) . (@kernels > 1 ? ' (choosing the first)' : ''));
+ $kernels[0]{pkg};
}
sub packagesOfMedium {