diff --git a/include/xbps_api.h b/include/xbps_api.h index 3736a966..8a481a57 100644 --- a/include/xbps_api.h +++ b/include/xbps_api.h @@ -56,7 +56,7 @@ */ #define XBPS_PKGINDEX_VERSION "1.5" -#define XBPS_API_VERSION "20120614" +#define XBPS_API_VERSION "20120614-1" #define XBPS_VERSION "0.16" /** diff --git a/lib/transaction_sortdeps.c b/lib/transaction_sortdeps.c index a7a9d836..ad2d9d30 100644 --- a/lib/transaction_sortdeps.c +++ b/lib/transaction_sortdeps.c @@ -147,13 +147,29 @@ pkgdep_alloc(prop_dictionary_t d, const char *name, const char *trans) static void pkgdep_end(prop_array_t sorted) { + prop_dictionary_t d; struct pkgdep *pd; + const char *trans; while ((pd = TAILQ_FIRST(&pkgdep_list)) != NULL) { 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); - + } pkgdep_release(pd); } }