summaryrefslogtreecommitdiffstats
path: root/libopkg
diff options
context:
space:
mode:
authorpixdamix@gmail.com <pixdamix@gmail.com@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>2012-11-22 04:18:31 (EST)
committer pixdamix@gmail.com <pixdamix@gmail.com@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>2012-11-22 04:18:31 (EST)
commitbf096c1dc02e069dd91c7239674cfee4a7513b09 (patch)
tree1c2f9f44d472c6e29b160a5e4c3db8a2a3c65a48 /libopkg
parent0431ebb4b98b4595648e3aa105b3502fb6e0a91e (diff)
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 <andrei@gherzan.ro> git-svn-id: http://opkg.googlecode.com/svn/trunk@647 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
Diffstat (limited to 'libopkg')
-rw-r--r--libopkg/pkg.c3
1 files changed, 2 insertions, 1 deletions
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 ? "" : ",",