[oe-commits] Andrei Gherzan : opkg: Don't print empty PROVIDES

git at git.openembedded.org git at git.openembedded.org
Tue Oct 23 11:29:27 UTC 2012


Module: openembedded-core.git
Branch: master-next
Commit: 19af022c73ebc53f7008a016c1e7c584fb7b0054
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=19af022c73ebc53f7008a016c1e7c584fb7b0054

Author: Andrei Gherzan <andrei at gherzan.ro>
Date:   Sun Oct 21 18:40:41 2012 +0300

opkg: Don't print empty PROVIDES

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 at gherzan.ro>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>

---

 ...n-t-print-provides-if-nothing-is-provided.patch |   24 ++++++++++++++++++++
 meta/recipes-devtools/opkg/opkg_svn.bb             |    3 +-
 2 files changed, 26 insertions(+), 1 deletions(-)

diff --git a/meta/recipes-devtools/opkg/opkg/don-t-print-provides-if-nothing-is-provided.patch b/meta/recipes-devtools/opkg/opkg/don-t-print-provides-if-nothing-is-provided.patch
new file mode 100644
index 0000000..669faef
--- /dev/null
+++ b/meta/recipes-devtools/opkg/opkg/don-t-print-provides-if-nothing-is-provided.patch
@@ -0,0 +1,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 at 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 ? "" : ",",
diff --git a/meta/recipes-devtools/opkg/opkg_svn.bb b/meta/recipes-devtools/opkg/opkg_svn.bb
index 3a90677..e1049a7 100644
--- a/meta/recipes-devtools/opkg/opkg_svn.bb
+++ b/meta/recipes-devtools/opkg/opkg_svn.bb
@@ -13,6 +13,7 @@ SRC_URI = "svn://opkg.googlecode.com/svn;module=trunk;protocol=http \
   file://0010-pkg_depends-fix-version_constraints_satisfied.patch \
   file://opkg-no-sync-offline.patch \
   file://don-t-add-recommends-pkgs-to-depended-upon-by.patch \
+  file://don-t-print-provides-if-nothing-is-provided.patch \
 "
 
 S = "${WORKDIR}/trunk"
@@ -20,4 +21,4 @@ S = "${WORKDIR}/trunk"
 SRCREV = "633"
 PV = "0.1.8+svnr${SRCPV}"
 
-PR = "${INC_PR}.7"
+PR = "${INC_PR}.8"





More information about the Openembedded-commits mailing list