ASP-based solver: prevent the use of hashes that are not available (#32354)

fixes #32348
This commit is contained in:
Massimiliano Culpo
2022-08-25 17:55:58 +02:00
committed by GitHub
parent b332c1055c
commit 8654197c56

View File

@@ -1059,6 +1059,11 @@ no_flags(Package, FlagType)
% you can't choose an installed hash for a dev spec
:- hash(Package, Hash), variant_value(Package, "dev_path", _).
% You can't install a hash, if it is not installed
:- hash(Package, Hash), not installed_hash(Package, Hash).
% This should be redundant given the constraint above
:- hash(Package, Hash1), hash(Package, Hash2), Hash1 != Hash2.
% if a hash is selected, we impose all the constraints that implies
impose(Hash) :- hash(Package, Hash).