summaryrefslogtreecommitdiff
path: root/src/upgrade.c
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2011-01-01 12:11:49 +0200
committerTimo Teräs <timo.teras@iki.fi>2011-01-01 12:11:49 +0200
commitb01d144c6922384921f808b190430ad7aa114010 (patch)
treeeb50d54cd075ee7ae0bd16617924afe80708e626 /src/upgrade.c
parentaae0a563edc21030c08fd47e30e78eda22183027 (diff)
downloadapk-tools-b01d144c6922384921f808b190430ad7aa114010.tar.gz
apk-tools-b01d144c6922384921f808b190430ad7aa114010.tar.bz2
apk-tools-b01d144c6922384921f808b190430ad7aa114010.tar.xz
apk-tools-b01d144c6922384921f808b190430ad7aa114010.zip
various: fix breakage from converting dependency versions to atoms
The version now needs to be initialized atom always, since it's dereferenced in various places.
Diffstat (limited to 'src/upgrade.c')
-rw-r--r--src/upgrade.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/upgrade.c b/src/upgrade.c
index b54d6c0..be6a499 100644
--- a/src/upgrade.c
+++ b/src/upgrade.c
@@ -34,6 +34,7 @@ static int upgrade_main(void *ctx, struct apk_database *db, int argc, char **arg
{
struct apk_state *state = NULL;
struct apk_name_array *missing;
+ apk_blob_t *null_atom = apk_blob_atomize(APK_BLOB_NULL);
int i, r = 0;
apk_flags |= APK_UPGRADE;
@@ -45,9 +46,10 @@ static int upgrade_main(void *ctx, struct apk_database *db, int argc, char **arg
for (i = 0; i < db->world->num; i++) {
struct apk_dependency *dep = &db->world->item[i];
- if (dep->version && (apk_flags & APK_PREFER_AVAILABLE)) {
+ if (dep->version != null_atom &&
+ (apk_flags & APK_PREFER_AVAILABLE)) {
dep->result_mask = APK_VERSION_EQUAL | APK_VERSION_LESS | APK_VERSION_GREATER;
- dep->version = NULL;
+ dep->version = null_atom;
}
if (dep->name->pkgs->num != 0)
r |= apk_state_lock_dependency(state, dep);