summaryrefslogtreecommitdiff
path: root/src/solver.c
diff options
context:
space:
mode:
authornrybowski <nicolas.rybowski@student.uclouvain.be>2019-12-10 02:14:49 +0100
committerTimo Teräs <timo.teras@iki.fi>2019-12-12 13:47:11 +0200
commit695a2f8231f11f690ba96d6c4b537e22dd6571fd (patch)
tree4ebffd0f2221d09ef40857937a11138a13f92d8b /src/solver.c
parentcfa8b736f897b9bf8906dd38538f6058a5ad2ba6 (diff)
downloadapk-tools-695a2f8231f11f690ba96d6c4b537e22dd6571fd.tar.gz
apk-tools-695a2f8231f11f690ba96d6c4b537e22dd6571fd.tar.bz2
apk-tools-695a2f8231f11f690ba96d6c4b537e22dd6571fd.tar.xz
apk-tools-695a2f8231f11f690ba96d6c4b537e22dd6571fd.zip
upgrade: implement --ignore to exclude some packages from upgrade
Diffstat (limited to 'src/solver.c')
-rw-r--r--src/solver.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/solver.c b/src/solver.c
index 2121dd9..25ea471 100644
--- a/src/solver.c
+++ b/src/solver.c
@@ -551,7 +551,8 @@ static int compare_providers(struct apk_solver_state *ss,
return r;
/* Prefer installed on self-upgrade */
- if (db->performing_self_upgrade && !(solver_flags & APK_SOLVERF_UPGRADE)) {
+ if ((db->performing_self_upgrade && !(solver_flags & APK_SOLVERF_UPGRADE)) ||
+ (solver_flags & APK_SOLVERF_IGNORE_UPGRADE)) {
r = (pkgA->ipkg != NULL) - (pkgB->ipkg != NULL);
if (r)
return r;
@@ -580,7 +581,8 @@ static int compare_providers(struct apk_solver_state *ss,
return r;
/* Prefer installed */
- if (!(solver_flags & APK_SOLVERF_UPGRADE)) {
+ if (!(solver_flags & APK_SOLVERF_UPGRADE) ||
+ (solver_flags & APK_SOLVERF_IGNORE_UPGRADE)) {
r = (pkgA->ipkg != NULL) - (pkgB->ipkg != NULL);
if (r)
return r;