Currently, packages specified with --add-exclude aren't registered at all
with libsolv. Because as far as libsolv is concerned they don't exist, if
an installation requires an excluded package, you get a less-than-ideal
message that "nothing provides" the excluded package.
Instead of pretending that they don't exist, instead utilize libsolv's
recent support for "blacklisted" packages. This changes the error output
to indicate that the excluded package "can only be installed by a direct
request"
Signed-off-by: Brandon Streiff <
brandon...@ni.com>
---
libopkg/solvers/libsolv/opkg_solver_libsolv.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/libopkg/solvers/libsolv/opkg_solver_libsolv.c b/libopkg/solvers/libsolv/opkg_solver_libsolv.c
index 941c1e3..a343033 100644
--- a/libopkg/solvers/libsolv/opkg_solver_libsolv.c
+++ b/libopkg/solvers/libsolv/opkg_solver_libsolv.c
@@ -567,10 +567,6 @@ static void populate_available_repos(libsolv_solver_t *libsolv_solver)
for (i = 0; i < available_pkgs->len; i++) {
pkg_t *pkg = available_pkgs->pkgs[i];
- /* if the package is marked as excluded, skip it */
- if (str_list_contains(&opkg_config->exclude_list, pkg->name, 1))
- continue;
-
/* if the package is installed or unpacked, skip it */
if (pkg->state_status == SS_INSTALLED ||
pkg->state_status == SS_UNPACKED ||
@@ -636,6 +632,15 @@ static void populate_available_repos(libsolv_solver_t *libsolv_solver)
| SOLVER_DISFAVOR, what);
}
+ /* if the package is marked as excluded, blacklist it */
+ if (str_list_contains(&opkg_config->exclude_list, pkg->name, 1)) {
+ opkg_message(DEBUG2, "Blacklist package due to exclusion: %s\n",
+ pkg->name);
+ what = pool_str2id(libsolv_solver->pool, pkg->name, 1);
+ queue_push2(&libsolv_solver->solver_jobs, SOLVER_SOLVABLE_NAME
+ | SOLVER_BLACKLIST, what);
+ }
+
/* if the --force-depends option is specified make dependencies weak */
if (opkg_config->force_depends)
queue_push2(&libsolv_solver->solver_jobs, SOLVER_SOLVABLE
--
2.20.1