xbps-repo: added 'show-deps' target to mimic xbps-bin(8).

As consequence of this, remove xbps_callback_array_iter_in_repolist().
Nowadays to iter over the repository pool we have a SIMPLEQ, this
allowed to simplify the code and remove some now unneeed stuff.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091124104704-oyvrmb3tmd59w4e7
This commit is contained in:
Juan RP
2009-11-24 10:47:04 +00:00
parent c676622869
commit 164c661bcf
7 changed files with 82 additions and 164 deletions

View File

@@ -33,29 +33,6 @@
#include "../xbps-repo/util.h"
#include "defs.h"
static int
list_deps(prop_object_t obj, void *arg, bool *loop_done)
{
char *pkgname;
const char *version;
(void)arg;
(void)loop_done;
assert(prop_object_type(obj) == PROP_TYPE_STRING);
pkgname = xbps_get_pkgdep_name(prop_string_cstring_nocopy(obj));
version = xbps_get_pkgdep_version(prop_string_cstring_nocopy(obj));
if (strcmp(version, ">=0") == 0)
printf("%s\n", pkgname);
else
printf("%s%s\n", pkgname, version);
free(pkgname);
return 0;
}
int
xbps_show_pkg_deps(const char *pkgname)
{
@@ -88,7 +65,7 @@ xbps_show_pkg_deps(const char *pkgname)
}
rv = xbps_callback_array_iter_in_dict(propsd, "run_depends",
list_deps, NULL);
list_strings_sep_in_array, NULL);
prop_object_release(propsd);
prop_object_release(pkgd);