From bd9b545fc96ca76ab2c309b10233c413638cdd5e Mon Sep 17 00:00:00 2001 From: Juan RP Date: Sun, 29 Nov 2009 05:52:32 +0100 Subject: [PATCH] xbps_find_pkg_repo_deps: check if current pkg version in repo is enough to satisfy the required rundep for a pkg! --HG-- extra : convert_revision : xtraeme%40gmail.com-20091129045232-ext4zxqrtsmbbqku --- lib/depends.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/lib/depends.c b/lib/depends.c index 9746e7ba..aa7c7682 100644 --- a/lib/depends.c +++ b/lib/depends.c @@ -311,7 +311,7 @@ find_repo_deps(prop_dictionary_t master, prop_dictionary_t repo, prop_object_t obj; prop_object_iterator_t iter; pkg_state_t state = 0; - const char *reqpkg, *reqvers, *pkg_queued; + const char *reqpkg, *reqvers, *pkg_queued, *repo_pkgver; char *pkgname; int rv = 0; @@ -381,7 +381,6 @@ find_repo_deps(prop_dictionary_t master, prop_dictionary_t repo, free(pkgname); continue; } - curpkgd = NULL; } /* @@ -415,6 +414,21 @@ find_repo_deps(prop_dictionary_t master, prop_dictionary_t repo, continue; } } + /* + * If version in repo does not satisfy the rundep, pass + * to the next rundep. + */ + if (!prop_dictionary_get_cstring_nocopy(curpkgd, + "pkgver", &repo_pkgver)) { + free(pkgname); + rv = errno; + break; + } + if (xbps_pkgdep_match(repo_pkgver, __UNCONST(reqpkg)) < 1) { + free(pkgname); + continue; + } + /* * If package is installed but version doesn't satisfy * the dependency mark it as an update, otherwise as