Fix and improve how missing pkg dependencies are handled from repos.

- Use an array of strings to store the pkgdeps.
- While adding a missing pkgdep, check if it's already in the queue and
  new required version is greater, in that case replace with new one.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091129021735-5dqfucofny8slks2
This commit is contained in:
Juan RP
2009-11-29 03:17:35 +01:00
parent eb0567bfab
commit 1a5d19dca2
3 changed files with 138 additions and 47 deletions

View File

@@ -56,20 +56,17 @@ show_missing_deps(prop_dictionary_t d, const char *pkgname)
static int
show_missing_dep_cb(prop_object_t obj, void *arg, bool *loop_done)
{
const char *pkgname, *version;
const char *reqpkg;
(void)arg;
(void)loop_done;
prop_dictionary_get_cstring_nocopy(obj, "pkgname", &pkgname);
prop_dictionary_get_cstring_nocopy(obj, "version", &version);
if (pkgname && version) {
printf(" * Missing binary package for: %s%s\n",
pkgname, version);
return 0;
}
reqpkg = prop_string_cstring_nocopy(obj);
if (reqpkg == NULL)
return EINVAL;
return EINVAL;
printf(" * Missing binary package for: %s\n", reqpkg);
return 0;
}
static bool