From 8b3b5c9d1a39410815938781e45625e6e77860ce Mon Sep 17 00:00:00 2001 From: Juan RP Date: Sat, 28 Nov 2009 05:52:00 +0100 Subject: [PATCH] xbps-bin, xbps-repo: use xbps_pkgdep_match() for the search target. This provides csh style shell pattern. --HG-- extra : convert_revision : xtraeme%40gmail.com-20091128045200-4rymuqm90rzmgiaw --- bin/xbps-repo/util.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/bin/xbps-repo/util.c b/bin/xbps-repo/util.c index 9d31ded9..c9def1f8 100644 --- a/bin/xbps-repo/util.c +++ b/bin/xbps-repo/util.c @@ -180,20 +180,19 @@ show_pkg_files(prop_dictionary_t filesd) int show_pkg_namedesc(prop_object_t obj, void *arg, bool *loop_done) { - const char *pkgname, *desc, *ver, *pattern = arg; + const char *pkgver, *desc; + char *pattern = arg; (void)loop_done; assert(prop_object_type(obj) == PROP_TYPE_DICTIONARY); assert(pattern != NULL); - prop_dictionary_get_cstring_nocopy(obj, "pkgname", &pkgname); + prop_dictionary_get_cstring_nocopy(obj, "pkgver", &pkgver); prop_dictionary_get_cstring_nocopy(obj, "short_desc", &desc); - prop_dictionary_get_cstring_nocopy(obj, "version", &ver); - if ((fnmatch(pattern, pkgname, 0) == 0) || - (fnmatch(pattern, desc, 0) == 0)) - printf(" %s-%s - %s\n", pkgname, ver, desc); + if (xbps_pkgdep_match(pkgver, pattern) == 1) + printf(" %s - %s\n", pkgver, desc); return 0; }