libxbps: when sorting deps take into account transaction reason.

This commit is contained in:
Juan RP 2011-10-15 20:00:41 +02:00
parent f2ede44c80
commit d3e1c0dcf2

View File

@ -70,9 +70,11 @@ pkgdep_find(const char *name, const char *trans)
} }
if (pd->d == NULL) if (pd->d == NULL)
continue; continue;
if (xbps_match_virtual_pkg_in_dict(pd->d, name, false)) if (xbps_match_virtual_pkg_in_dict(pd->d, name, false)) {
if (trans == pd->trans)
return pd; return pd;
} }
}
/* not found */ /* not found */
return NULL; return NULL;
@ -93,8 +95,10 @@ pkgdep_find_idx(const char *name, const char *trans)
} }
if (pd->d == NULL) if (pd->d == NULL)
continue; continue;
if (xbps_match_virtual_pkg_in_dict(pd->d, name, false)) if (xbps_match_virtual_pkg_in_dict(pd->d, name, false)) {
if (trans == pd->trans)
return idx; return idx;
}
idx++; idx++;
} }
@ -343,7 +347,7 @@ xbps_sort_pkg_deps(void)
prop_dictionary_get_cstring_nocopy(obj, "pkgname", &pkgname); prop_dictionary_get_cstring_nocopy(obj, "pkgname", &pkgname);
prop_dictionary_get_cstring_nocopy(obj, "pkgver", &pkgver); prop_dictionary_get_cstring_nocopy(obj, "pkgver", &pkgver);
prop_dictionary_get_cstring_nocopy(obj, "transaction", &tract); prop_dictionary_get_cstring_nocopy(obj, "transaction", &tract);
xbps_dbg_printf("Sorting package '%s': ", pkgver); xbps_dbg_printf("Sorting package '%s' (%s): ", pkgver, tract);
pd = pkgdep_find(pkgname, tract); pd = pkgdep_find(pkgname, tract);
if (pd == NULL) { if (pd == NULL) {