From bf096c1dc02e069dd91c7239674cfee4a7513b09 Mon Sep 17 00:00:00 2001 From: pixdamix@gmail.com Date: Thu, 22 Nov 2012 04:18:31 -0500 Subject: Don't print provides if nothing is provided Every package provides itself. While printing package information all fields are printed only if there is any relevant info for them. For example: a package with no "Replaces" won't get this printed at all. Packages which provide only themselves, were printing this field but with no values. This patch skips this field if the package provides only itself. Signed-off-by: Andrei Gherzan git-svn-id: http://opkg.googlecode.com/svn/trunk@647 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358 --- (limited to 'libopkg') diff --git a/libopkg/pkg.c b/libopkg/pkg.c index 23055f3..9d48576 100644 --- a/libopkg/pkg.c +++ b/libopkg/pkg.c @@ -731,7 +731,8 @@ pkg_formatted_field(FILE *fp, pkg_t *pkg, const char *field) } else if (strcasecmp(field, "Priority") == 0) { fprintf(fp, "Priority: %s\n", pkg->priority); } else if (strcasecmp(field, "Provides") == 0) { - if (pkg->provides_count) { + /* Don't print provides if this package provides only itself */ + if (pkg->provides_count > 1) { fprintf(fp, "Provides:"); for(i = 1; i < pkg->provides_count; i++) { fprintf(fp, "%s %s", i == 1 ? "" : ",", -- cgit v0.9.1