diff options
author | Timo Teräs <timo.teras@iki.fi> | 2022-02-06 21:37:31 +0200 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2022-02-21 10:24:05 +0200 |
commit | 3ad4d6bed139272fd9a775165ed25ed45ffa24fb (patch) | |
tree | 155e9548893ca1f6409422afa9f9ad118cf16ac4 /src | |
parent | 21519221c2a62ccd41152ddb3331b1ebee5f686e (diff) | |
download | apk-tools-3ad4d6bed139272fd9a775165ed25ed45ffa24fb.tar.gz apk-tools-3ad4d6bed139272fd9a775165ed25ed45ffa24fb.tar.bz2 apk-tools-3ad4d6bed139272fd9a775165ed25ed45ffa24fb.tar.xz apk-tools-3ad4d6bed139272fd9a775165ed25ed45ffa24fb.zip |
solver: require package layer to be enabled for install
Diffstat (limited to 'src')
-rw-r--r-- | src/commit.c | 3 | ||||
-rw-r--r-- | src/solver.c | 7 |
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 |