state: handle properly packages which are installed

Installed package does not need to be checked for availability.
Account for packages missing if they get pruned out due to
installability check.
cute-signatures
Timo Teräs 2010-06-15 18:31:45 +03:00
parent 7ae592a4fa
commit e706f63eda
1 changed files with 3 additions and 0 deletions

View File

@ -178,6 +178,8 @@ static void ns_free(apk_name_state_t name)
static inline int apk_state_pkg_available(struct apk_state *state,
struct apk_package *pkg)
{
if (pkg->ipkg != NULL)
return TRUE;
if (pkg->installed_size == 0)
return TRUE;
if (pkg->filename != NULL)
@ -316,6 +318,7 @@ int apk_state_prune_dependency(struct apk_state *state,
if (c->num <= 1) {
name_choices_unref(c);
state->name[name->id] = ns_from_pkg(NULL);
*apk_name_array_add(&state->missing) = name;
return -1;
}