A virtual package does not have SelectedState Install, but the
dependency will still be satisfied if a package providing it has.
Fixes a bug, wrongly showing that postfix will be installed, when a
different mail-transport-agent is installed and a pve-manager update
is available:
https://forum.proxmox.com/threads/103413/
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
for my $d (@$deps) {
if ($d->{DepType} eq 'Depends') {
$found = $d->{TargetPkg}->{SelectedState} eq 'Install' if !$found;
+ # need to check ProvidesList for virtual packages
+ if (!$found && (my $provides = $d->{TargetPkg}->{ProvidesList})) {
+ for my $provide ($provides->@*) {
+ $found = $provide->{OwnerPkg}->{SelectedState} eq 'Install';
+ last if $found;
+ }
+ }
$req = $d->{TargetPkg} if !$req;
if (!($d->{CompType} & AptPkg::Dep::Or)) {