diff options
author | Francois Pons <fpons@mandriva.com> | 2001-03-14 17:21:50 +0000 |
---|---|---|
committer | Francois Pons <fpons@mandriva.com> | 2001-03-14 17:21:50 +0000 |
commit | 4b9754b7d0ab79ef7e655b3a8ecf8f3826ed6fee (patch) | |
tree | 7319432b9906276838be5e4f09438d58613d56ef /perl-install/pkgs.pm | |
parent | 90e4f82561eca36664770b44f1792a7cea4353c0 (diff) | |
download | drakx-4b9754b7d0ab79ef7e655b3a8ecf8f3826ed6fee.tar drakx-4b9754b7d0ab79ef7e655b3a8ecf8f3826ed6fee.tar.gz drakx-4b9754b7d0ab79ef7e655b3a8ecf8f3826ed6fee.tar.bz2 drakx-4b9754b7d0ab79ef7e655b3a8ecf8f3826ed6fee.tar.xz drakx-4b9754b7d0ab79ef7e655b3a8ecf8f3826ed6fee.zip |
fixed unselect management of choice, propagate unselection correctly to all
packages requiring unselected package.
Diffstat (limited to 'perl-install/pkgs.pm')
-rw-r--r-- | perl-install/pkgs.pm | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/perl-install/pkgs.pm b/perl-install/pkgs.pm index 2869a6d25..878e5f8c3 100644 --- a/perl-install/pkgs.pm +++ b/perl-install/pkgs.pm @@ -271,22 +271,26 @@ sub unselectPackage($$;$) { foreach my $provided ($pkg, packageProvides($packages, $pkg)) { packageFlagBase($provided) and die "a provided package cannot be a base package"; if (packageFlagSelected($provided)) { - my $unselect_alone = 0; + my $unselect_alone = 1; foreach (packageDepsId($provided)) { + $unselect_alone = 0; if (/\|/) { #- this package use a choice of other package, so we have to check #- if our package is not included in the choice, if this is the #- case, if must be checked one of the other package are selected. foreach (split '\|') { my $dep = packageById($packages, $_); - $dep == $pkg and $unselect_alone |= 1; + $dep == $pkg and $unselect_alone |= 1 and next; packageFlagBase($dep) || packageFlagSelected($dep) and $unselect_alone |= 2; } + } else { + packageById($packages, $_) == $pkg and $unselect_alone = 1; } + $unselect_alone == 1 and last; } - #- provided will not be unselect here if the two conditions are met. - $unselect_alone == 3 and next; - #- on the other hand, provided package have to be unselected. + #- if package has been found and nothing more selected, + #- deselect the provided, or we can ignore it safely. + $provided == $pkg || $unselect_alone == 1 or next; $otherOnly or packageSetFlagSelected($provided, 0); $otherOnly and $otherOnly->{packageName($provided)} = 1; } |