summaryrefslogtreecommitdiff
path: root/src/search.c
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2010-12-14 19:51:16 +0200
committerTimo Teräs <timo.teras@iki.fi>2010-12-14 19:51:16 +0200
commit972bec32101fb6d03f82fdf1f3be6106097fbf37 (patch)
tree532e989e0b13f2d0659426b3f385265240efc524 /src/search.c
parentfca1c30b801537ce35c1e4aa50331ae52c9bf567 (diff)
downloadapk-tools-972bec32101fb6d03f82fdf1f3be6106097fbf37.tar.gz
apk-tools-972bec32101fb6d03f82fdf1f3be6106097fbf37.tar.bz2
apk-tools-972bec32101fb6d03f82fdf1f3be6106097fbf37.tar.xz
apk-tools-972bec32101fb6d03f82fdf1f3be6106097fbf37.zip
various: use 'atoms' for certain package field and misc fixes
- implement a hash table for commonly shared fields such as license, version and architecture - use macroes to print blobs or pkgname-pkgver strings - fix some old cruft
Diffstat (limited to 'src/search.c')
-rw-r--r--src/search.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/search.c b/src/search.c
index 14eb0fb..cb8c44d 100644
--- a/src/search.c
+++ b/src/search.c
@@ -28,10 +28,9 @@ static int print_match(struct apk_package *pkg)
{
printf("%s", pkg->name->name);
if (apk_verbosity > 0)
- printf("-%s", pkg->version);
- if (apk_verbosity > 1) {
+ printf("-" BLOB_FMT, BLOB_PRINTF(*pkg->version));
+ if (apk_verbosity > 1)
printf(" - %s", pkg->description);
- }
printf("\n");
return 0;
@@ -46,7 +45,7 @@ static int print_rdepends(struct apk_package *pkg)
name = pkg->name;
- printf("%s-%s:", pkg->name->name, pkg->version);
+ printf(PKG_VER_FMT ":", PKG_VER_PRINTF(pkg));
for (i = 0; i < name->rdepends->num; i++) {
name0 = name->rdepends->item[i];
for (j = 0; j < name0->pkgs->num; j++) {
@@ -54,9 +53,10 @@ static int print_rdepends(struct apk_package *pkg)
for (k = 0; k < pkg0->depends->num; k++) {
dep = &pkg0->depends->item[k];
if (name == dep->name &&
- (apk_version_compare(pkg->version, dep->version)
+ (apk_version_compare_blob(*pkg->version, *dep->version)
& dep->result_mask)) {
- printf(" %s-%s", pkg0->name->name, pkg0->version);
+ printf(" " PKG_VER_FMT,
+ PKG_VER_PRINTF(pkg0));
}
}
}