libxbps: do not add dups to transaction dictionary due to virtual pkgs.

This commit is contained in:
Juan RP 2012-06-14 11:53:27 +02:00
parent 29871b2120
commit 302b216d8d
2 changed files with 19 additions and 3 deletions

View File

@ -56,7 +56,7 @@
*/ */
#define XBPS_PKGINDEX_VERSION "1.5" #define XBPS_PKGINDEX_VERSION "1.5"
#define XBPS_API_VERSION "20120614" #define XBPS_API_VERSION "20120614-1"
#define XBPS_VERSION "0.16" #define XBPS_VERSION "0.16"
/** /**

View File

@ -147,13 +147,29 @@ pkgdep_alloc(prop_dictionary_t d, const char *name, const char *trans)
static void static void
pkgdep_end(prop_array_t sorted) pkgdep_end(prop_array_t sorted)
{ {
prop_dictionary_t d;
struct pkgdep *pd; struct pkgdep *pd;
const char *trans;
while ((pd = TAILQ_FIRST(&pkgdep_list)) != NULL) { while ((pd = TAILQ_FIRST(&pkgdep_list)) != NULL) {
TAILQ_REMOVE(&pkgdep_list, pd, pkgdep_entries); TAILQ_REMOVE(&pkgdep_list, pd, pkgdep_entries);
if (sorted != NULL && pd->d != NULL) if (sorted != NULL && pd->d != NULL) {
/* do not add duplicates due to vpkgs */
d = xbps_find_pkg_in_array_by_name(sorted,
pd->name, NULL);
if (d == NULL) {
prop_array_add(sorted, pd->d);
pkgdep_release(pd);
continue;
}
prop_dictionary_get_cstring_nocopy(d,
"transaction", &trans);
if (strcmp(trans, pd->trans) == 0) {
pkgdep_release(pd);
continue;
}
prop_array_add(sorted, pd->d); prop_array_add(sorted, pd->d);
}
pkgdep_release(pd); pkgdep_release(pd);
} }
} }