summaryrefslogtreecommitdiff
path: root/src/state.c
diff options
context:
space:
mode:
authorTimo Teras <timo.teras@iki.fi>2009-08-04 15:19:29 +0300
committerTimo Teras <timo.teras@iki.fi>2009-08-04 15:19:29 +0300
commit1fea5639b455ae4267a7dc17ef19b8d2506978b0 (patch)
treeb02744d22dd0c762bf4b3d6e57b5229f223d8f29 /src/state.c
parentec2ade154289ce587eab3375445a33cad992c234 (diff)
downloadapk-tools-1fea5639b455ae4267a7dc17ef19b8d2506978b0.tar.gz
apk-tools-1fea5639b455ae4267a7dc17ef19b8d2506978b0.tar.bz2
apk-tools-1fea5639b455ae4267a7dc17ef19b8d2506978b0.tar.xz
apk-tools-1fea5639b455ae4267a7dc17ef19b8d2506978b0.zip
fix: new applet to reinstall and fix package
also makes it possibly to upgrade package without adding it to top-level deps. fixes #69.
Diffstat (limited to 'src/state.c')
-rw-r--r--src/state.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/state.c b/src/state.c
index 28a411f..c723460 100644
--- a/src/state.c
+++ b/src/state.c
@@ -319,7 +319,9 @@ int apk_state_lock_dependency(struct apk_state *state,
if (apk_flags & APK_UPGRADE) {
use = latest;
} else {
- if (installed != NULL)
+ if (installed != NULL &&
+ (installed->repos != 0 ||
+ !(name->flags & APK_NAME_REINSTALL)))
use = installed;
else
use = latest;
@@ -500,7 +502,7 @@ int apk_state_lock_name(struct apk_state *state,
}
/* If the chosen package is installed, all is done here */
- if (oldpkg == newpkg)
+ if (oldpkg == newpkg && !(newpkg->name->flags & APK_NAME_REINSTALL))
return 0;
/* Track change */