summaryrefslogtreecommitdiffstats
path: root/src/state.c
diff options
context:
space:
mode:
authorTimo Teras <timo.teras@iki.fi>2009-01-16 13:59:36 +0200
committerTimo Teras <timo.teras@iki.fi>2009-01-16 13:59:36 +0200
commit3e6fc1389f1cdd06bf18b8fd6cd741c8b9e3e1f2 (patch)
treec152bd82b0fbb5e573a944534d670a54a5a3bbc6 /src/state.c
parent6354a278883161704c7f8650a3bdde77f163c6ad (diff)
downloadapk-tools-3e6fc1389f1cdd06bf18b8fd6cd741c8b9e3e1f2.tar.bz2
apk-tools-3e6fc1389f1cdd06bf18b8fd6cd741c8b9e3e1f2.tar.xz
add: --upgrade|-u to control if upgrading is preferred or not
Diffstat (limited to 'src/state.c')
-rw-r--r--src/state.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/state.c b/src/state.c
index 3b93fc1..a6aaf7f 100644
--- a/src/state.c
+++ b/src/state.c
@@ -205,7 +205,7 @@ int apk_state_satisfy_name(struct apk_state *state,
struct apk_name *name)
{
struct apk_package *preferred = NULL, *installed = NULL;
- int i, r, upgrading = 1;
+ int i, r;
/* Is something already installed? Or figure out the preferred
* package. */
@@ -216,9 +216,9 @@ int apk_state_satisfy_name(struct apk_state *state,
if (apk_pkg_get_state(name->pkgs->item[i]) == APK_STATE_INSTALL) {
installed = name->pkgs->item[i];
- if (!upgrading) {
+ if (!apk_upgrade) {
preferred = installed;
- continue;
+ break;
}
}