Use best pkg available when resolving required dependencies.
This commit is contained in:
3
NEWS
3
NEWS
@ -1,5 +1,8 @@
|
|||||||
xbps-0.15 (???):
|
xbps-0.15 (???):
|
||||||
|
|
||||||
|
* When resolving required dependencies also find the best pkg
|
||||||
|
available in repository pool. Thanks to dave for testing!
|
||||||
|
|
||||||
* Started a test suite for libxbps. Tests are written for Kyua
|
* Started a test suite for libxbps. Tests are written for Kyua
|
||||||
(http://code.google.com/p/kyua) and can be built and installed
|
(http://code.google.com/p/kyua) and can be built and installed
|
||||||
with the --with-tests configure option, by default will be installed
|
with the --with-tests configure option, by default will be installed
|
||||||
|
@ -56,7 +56,7 @@
|
|||||||
*/
|
*/
|
||||||
#define XBPS_PKGINDEX_VERSION "1.4"
|
#define XBPS_PKGINDEX_VERSION "1.4"
|
||||||
|
|
||||||
#define XBPS_API_VERSION "20120324"
|
#define XBPS_API_VERSION "20120328"
|
||||||
#define XBPS_VERSION "0.15"
|
#define XBPS_VERSION "0.15"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -38,7 +38,8 @@ store_dependency(prop_dictionary_t transd,
|
|||||||
{
|
{
|
||||||
const struct xbps_handle *xhp = xbps_handle_get();
|
const struct xbps_handle *xhp = xbps_handle_get();
|
||||||
prop_array_t array;
|
prop_array_t array;
|
||||||
const char *pkgname, *pkgver, *repoloc;
|
prop_dictionary_t curpkgd;
|
||||||
|
const char *pkgname, *pkgver, *repoloc, *curpkgver;
|
||||||
size_t x;
|
size_t x;
|
||||||
int rv = 0;
|
int rv = 0;
|
||||||
|
|
||||||
@ -50,6 +51,21 @@ store_dependency(prop_dictionary_t transd,
|
|||||||
prop_dictionary_get_cstring_nocopy(repo_pkgd, "pkgname", &pkgname);
|
prop_dictionary_get_cstring_nocopy(repo_pkgd, "pkgname", &pkgname);
|
||||||
prop_dictionary_get_cstring_nocopy(repo_pkgd, "pkgver", &pkgver);
|
prop_dictionary_get_cstring_nocopy(repo_pkgd, "pkgver", &pkgver);
|
||||||
prop_dictionary_get_cstring_nocopy(repo_pkgd, "repository", &repoloc);
|
prop_dictionary_get_cstring_nocopy(repo_pkgd, "repository", &repoloc);
|
||||||
|
/*
|
||||||
|
* Check if same pkg is already in transaction, and if current pkg version
|
||||||
|
* is greater add it, otherwise drop it.
|
||||||
|
*/
|
||||||
|
curpkgd = xbps_find_pkg_in_dict_by_name(transd, "unsorted_deps", pkgname);
|
||||||
|
if (curpkgd != NULL) {
|
||||||
|
prop_dictionary_get_cstring_nocopy(curpkgd, "pkgver", &curpkgver);
|
||||||
|
rv = xbps_cmpver(pkgver, curpkgver);
|
||||||
|
if (rv == 1) {
|
||||||
|
xbps_remove_pkg_from_dict_by_name(transd,
|
||||||
|
"unsorted_deps", pkgname);
|
||||||
|
xbps_dbg_printf("%s: found pkg `%s' in transaction, replaced by `%s'.\n",
|
||||||
|
__func__, curpkgver, pkgver);
|
||||||
|
}
|
||||||
|
}
|
||||||
/*
|
/*
|
||||||
* Overwrite package state in dictionary with same state than the
|
* Overwrite package state in dictionary with same state than the
|
||||||
* package currently uses, otherwise not-installed.
|
* package currently uses, otherwise not-installed.
|
||||||
@ -61,6 +77,7 @@ store_dependency(prop_dictionary_t transd,
|
|||||||
*/
|
*/
|
||||||
if (!prop_dictionary_set_bool(repo_pkgd, "automatic-install", true))
|
if (!prop_dictionary_set_bool(repo_pkgd, "automatic-install", true))
|
||||||
return errno;
|
return errno;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Add the dictionary into the array.
|
* Add the dictionary into the array.
|
||||||
*/
|
*/
|
||||||
@ -372,7 +389,7 @@ find_repo_deps(prop_dictionary_t transd, /* transaction dictionary */
|
|||||||
curpkgd = xbps_repository_pool_find_virtualpkg(reqpkg, true);
|
curpkgd = xbps_repository_pool_find_virtualpkg(reqpkg, true);
|
||||||
if (curpkgd == NULL) {
|
if (curpkgd == NULL) {
|
||||||
curpkgd = xbps_repository_pool_find_pkg(reqpkg, true,
|
curpkgd = xbps_repository_pool_find_pkg(reqpkg, true,
|
||||||
false);
|
true);
|
||||||
if (curpkgd == NULL) {
|
if (curpkgd == NULL) {
|
||||||
/* pkg not found, there was some error */
|
/* pkg not found, there was some error */
|
||||||
if (errno && errno != ENOENT) {
|
if (errno && errno != ENOENT) {
|
||||||
|
Reference in New Issue
Block a user