summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2001-07-25 15:40:45 +0000
committerFrancois Pons <fpons@mandriva.com>2001-07-25 15:40:45 +0000
commit43149ab549f7e43bb1af88c1cbc95dc014a03dd7 (patch)
tree53e39362d0d40691170a35c4d22c2eef154e186e
parenta0b65cdf7315da8f70a281fcd12696d8e53c470c (diff)
downloaddrakx-backup-do-not-use-43149ab549f7e43bb1af88c1cbc95dc014a03dd7.tar
drakx-backup-do-not-use-43149ab549f7e43bb1af88c1cbc95dc014a03dd7.tar.gz
drakx-backup-do-not-use-43149ab549f7e43bb1af88c1cbc95dc014a03dd7.tar.bz2
drakx-backup-do-not-use-43149ab549f7e43bb1af88c1cbc95dc014a03dd7.tar.xz
drakx-backup-do-not-use-43149ab549f7e43bb1af88c1cbc95dc014a03dd7.zip
fixed no test (or die test) to void package read on depslist (allowed to keep
package indexing good on multi-arch).
-rw-r--r--perl-install/pkgs.pm13
1 files changed, 8 insertions, 5 deletions
diff --git a/perl-install/pkgs.pm b/perl-install/pkgs.pm
index 146a5b6ea..3ca58be51 100644
--- a/perl-install/pkgs.pm
+++ b/perl-install/pkgs.pm
@@ -183,7 +183,7 @@ sub packageByName {
}
sub packageById {
my ($packages, $id) = @_;
- $packages->{depslist}[$id] or log::l("unknown package id $id") && undef;
+ $packages->{depslist}[$id]; #- do not log as id unsupported are still in depslist.
}
sub packagesOfMedium {
my ($packages, $mediumName) = @_;
@@ -573,9 +573,10 @@ sub getProvides($) {
#- packages can be managed by DrakX (currently about 2000).
my $i = 0;
foreach my $pkg (@{$packages->{depslist}}) {
+ $pkg or next;
unless (packageFlagBase($pkg)) {
foreach (map { split '\|' } grep { !/^NOTFOUND_/ } packageDepsId($pkg)) {
- my $provided = $packages->{depslist}[$_] or die "invalid package index $_";
+ my $provided = $packages->{depslist}[$_] or next;
packageFlagBase($provided) or $provided->[$PROVIDES] = pack "s*", (unpack "s*", $provided->[$PROVIDES]), $i;
}
}
@@ -1507,7 +1508,7 @@ sub selected_leaves {
#- initialize l with all id, not couting base package.
foreach my $id (0 .. $#{$packages->{depslist}}) {
- my $pkg = $packages->{depslist}[$id];
+ my $pkg = $packages->{depslist}[$id] or next;
packageSelectedOrInstalled($pkg) && !packageFlagBase($pkg) or next;
$l{$id} = 1;
}
@@ -1516,7 +1517,8 @@ sub selected_leaves {
#- when a package is in a choice, increase its value in hash l, because
#- it has to be examined before when we will select them later.
#- NB: this number may be computed before to save time.
- foreach (packageDepsId($packages->{depslist}[$id])) {
+ my $p = $packages->{depslist}[$id] or next;
+ foreach (packageDepsId($p)) {
if (/\|/) {
foreach (split '\|') {
exists $l{$_} or next;
@@ -1532,7 +1534,8 @@ sub selected_leaves {
#- do not count already deleted id, else cycles will be removed.
$l{$id} or next;
- foreach (packageDepsId($packages->{depslist}[$id])) {
+ my $p = $packages->{depslist}[$id] or next;
+ foreach (packageDepsId($p)) {
#- choices need no more to be examined, this has been done above.
/\|/ and next;
#- improve value of this one, so it will be selected before.