summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@redhat.com>2008-06-29 22:03:13 -0400
committerKristian Høgsberg <krh@redhat.com>2008-06-30 13:26:55 -0400
commit2d4487425bcbca6b4f0f86aaa8e2f276ec54c0a5 (patch)
tree7f82d68cf37be05bcba7c9047669e2d6361ddf88 /src/main.c
parente911090d427fcf3cf57fa57d51c65cf724be770d (diff)
Tweak razor search a bit: casefold, print summary, search rawhide instead.
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c32
1 files changed, 15 insertions, 17 deletions
diff --git a/src/main.c b/src/main.c
index 7fd0f51..f680d1f 100644
--- a/src/main.c
+++ b/src/main.c
@@ -17,6 +17,8 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#define _GNU_SOURCE
+
#include <stdlib.h>
#include <stddef.h>
#include <stdio.h>
@@ -891,31 +893,27 @@ command_search(int argc, const char *argv[])
snprintf(pattern, sizeof pattern, "*%s*", argv[0]);
- set = razor_set_open(repo_filename);
+ set = razor_set_open(rawhide_repo_filename);
if (set == NULL)
return 1;
- if (razor_set_open_details(set, "system-details.repo"))
+ if (razor_set_open_details(set, "rawhide-details.repo"))
return 1;
pi = razor_package_iterator_create(set);
while (razor_package_iterator_next(pi, &package,
RAZOR_DETAIL_NAME, &name,
RAZOR_DETAIL_VERSION, &version,
- RAZOR_DETAIL_ARCH, &arch, NULL)) {
- if (!fnmatch(pattern, name, 0))
- printf("%s-%s.%s\n", name, version, arch);
- else {
- razor_package_get_details (set, package,
- RAZOR_DETAIL_SUMMARY, &summary,
- RAZOR_DETAIL_DESCRIPTION, &description,
- RAZOR_DETAIL_URL, &url,
- RAZOR_DETAIL_LICENSE, &license,
- NULL);
- if (!fnmatch(pattern, url, 0) ||
- !fnmatch(pattern, summary, 0) ||
- !fnmatch(pattern, description, 0))
- printf("%s-%s.%s\n", name, version, arch);
- }
+ RAZOR_DETAIL_ARCH, &arch,
+ RAZOR_DETAIL_SUMMARY, &summary,
+ RAZOR_DETAIL_DESCRIPTION, &description,
+ RAZOR_DETAIL_URL, &url,
+ RAZOR_DETAIL_LICENSE, &license,
+ NULL)) {
+ if (!fnmatch(pattern, name, FNM_CASEFOLD) ||
+ !fnmatch(pattern, url, FNM_CASEFOLD) ||
+ !fnmatch(pattern, summary, FNM_CASEFOLD) ||
+ !fnmatch(pattern, description, FNM_CASEFOLD))
+ printf("%s-%s.%s: %s\n", name, version, arch, summary);
}
razor_package_iterator_destroy(pi);
razor_set_destroy(set);