aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2022-02-06 21:37:31 +0200
committerTimo Teräs <timo.teras@iki.fi>2022-02-06 21:37:31 +0200
commit696bba74a59396f36fee6619603762a5803e1b0a (patch)
treecc88b801feb96b8e23d695d2e335b41fc16b1b6f
parent34819366d27f8a7013ef54dcd67e5168f88bb9f7 (diff)
downloadapk-tools-696bba74a59396f36fee6619603762a5803e1b0a.tar.gz
apk-tools-696bba74a59396f36fee6619603762a5803e1b0a.tar.bz2
apk-tools-696bba74a59396f36fee6619603762a5803e1b0a.tar.xz
solver: require package layer to be enabled for installtt-layers
-rw-r--r--src/commit.c3
-rw-r--r--src/solver.c7
2 files changed, 7 insertions, 3 deletions
diff --git a/src/commit.c b/src/commit.c
index 6130f36..42280aa 100644
--- a/src/commit.c
+++ b/src/commit.c
@@ -425,6 +425,9 @@ static void print_pinning_errors(struct print_state *ps, struct apk_package *pkg
if (!(pkg->repos & db->available_repos)) {
label_start(ps, "masked in:");
apk_print_indented_fmt(&ps->i, "--no-network");
+ } else if (!(BIT(pkg->layer) & db->active_layers)) {
+ label_start(ps, "masked in:");
+ apk_print_indented_fmt(&ps->i, "layer");
} else if (pkg->repos == BIT(APK_REPOSITORY_CACHED) && !pkg->filename) {
label_start(ps, "masked in:");
apk_print_indented_fmt(&ps->i, "cache");
diff --git a/src/solver.c b/src/solver.c
index 3283659..fc73642 100644
--- a/src/solver.c
+++ b/src/solver.c
@@ -198,9 +198,10 @@ static void discover_name(struct apk_solver_state *ss, struct apk_name *name)
/* Package is in 'cached' repository if filename is provided,
* or it's a 'virtual' package with install_size zero */
pkg->ss.pkg_selectable =
- (pkg->repos & db->available_repos) ||
- pkg->cached_non_repository ||
- pkg->ipkg;
+ (BIT(pkg->layer) & db->active_layers) &&
+ ((pkg->repos & db->available_repos) ||
+ pkg->cached_non_repository ||
+ pkg->ipkg);
/* Prune install_if packages that are no longer available,
* currently works only if SOLVERF_AVAILABLE is set in the