When finding package orphans, only report those with "installed" state.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20090822054123-1bud3ldgin5opbhc
This commit is contained in:
Juan RP 2009-08-22 07:41:23 +02:00
parent 59b1942617
commit 14c9886cfc

View File

@ -50,6 +50,8 @@ find_orphan_pkg(prop_object_t obj, void *arg, bool *loop_done)
char *pkgname;
unsigned int ndep = 0, cnt = 0;
bool automatic = false;
pkg_state_t state = 0;
int rv = 0;
(void)arg;
(void)loop_done;
@ -60,6 +62,12 @@ find_orphan_pkg(prop_object_t obj, void *arg, bool *loop_done)
if (!automatic)
return 0;
if ((rv = xbps_get_pkg_state_dictionary(obj, &state)) != 0)
return rv;
if (state != XBPS_PKG_STATE_INSTALLED)
return 0;
reqby = prop_dictionary_get(obj, "requiredby");
if (reqby == NULL)
return 0;