summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/opkg/opkg/don-t-print-provides-if-nothing-is-provided.patch
blob: 669faef00a2cca5a1f3d279c1ec92f97f52a9cb0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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.

Upstream-Status: Pending
Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>

Index: trunk/libopkg/pkg.c
===================================================================
--- trunk.orig/libopkg/pkg.c	2011-12-18 02:11:34.000000000 +0200
+++ trunk/libopkg/pkg.c	2012-10-20 22:20:04.109201287 +0300
@@ -731,7 +731,8 @@
 	  } 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 ? "" : ",",