various: use APK_DEPMASK_REQUIRE where applicable

.. instead of the longer flag combo.
cute-signatures
Timo Teräs 2011-01-01 16:04:42 +02:00
parent 59d222d58c
commit 6582676150
2 changed files with 3 additions and 3 deletions

View File

@ -193,7 +193,7 @@ int apk_dep_from_blob(struct apk_dependency *dep, struct apk_database *db,
{ {
struct apk_name *name; struct apk_name *name;
apk_blob_t bname, bop, bver = APK_BLOB_NULL; apk_blob_t bname, bop, bver = APK_BLOB_NULL;
int mask = APK_VERSION_LESS | APK_VERSION_EQUAL | APK_VERSION_GREATER; int mask = APK_DEPMASK_REQUIRE;
/* [!]name[<,<=,=,>=,>]ver */ /* [!]name[<,<=,=,>=,>]ver */
if (blob.ptr[0] == '!') { if (blob.ptr[0] == '!') {

View File

@ -43,7 +43,7 @@ int apk_do_self_upgrade(struct apk_database *db, struct apk_state *state)
if (dep0->name != dep.name) if (dep0->name != dep.name)
continue; continue;
dep0->version = apk_blob_atomize(APK_BLOB_NULL); dep0->version = apk_blob_atomize(APK_BLOB_NULL);
dep0->result_mask = APK_VERSION_EQUAL | APK_VERSION_LESS | APK_VERSION_GREATER; dep0->result_mask = APK_DEPMASK_REQUIRE;
break; break;
} }
} }
@ -94,7 +94,7 @@ static int upgrade_main(void *ctx, struct apk_database *db, int argc, char **arg
struct apk_dependency *dep = &db->world->item[i]; struct apk_dependency *dep = &db->world->item[i];
if (dep->version != null_atom && if (dep->version != null_atom &&
(apk_flags & APK_PREFER_AVAILABLE)) { (apk_flags & APK_PREFER_AVAILABLE)) {
dep->result_mask = APK_VERSION_EQUAL | APK_VERSION_LESS | APK_VERSION_GREATER; dep->result_mask = APK_DEPMASK_REQUIRE;
dep->version = null_atom; dep->version = null_atom;
} }
if (dep->name->pkgs->num != 0) if (dep->name->pkgs->num != 0)