Skip to contentSkip to conversation

FIX #2431 and other opkg / ipk related fixes

PATCH Applied Andrei Gherzan 3 participants 8 messages Oct 21, 2012 – Oct 23, 2012

lore
Share & tools
lore
#0 lore raw

v2 cover FIX #2431 and other opkg / ipk related fixes

V2:
Have rootfs_ipk.bbclass formatting changings in a different commit.
Thanks: Otavio Salvador <[email protected]>

The following changes since commit caba9cbfce09f19eb27f4c6615c0c5c48e1a2952:

kernel.bbclass: add kernel-modules to PACKAGES (2012-10-19 23:06:26 +0100)

are available in the git repository at:

git://git.yoctoproject.org/poky-contrib ag/opkg
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=ag/opkg

Andrei Gherzan (5):
opkg-utils: Add needed python modules as RDEPENDS
opkg: Add patch to fix removing packages with recommends
opkg: Don't print empty PROVIDES
rootfs_ipk.bbclass: Don't duplicate remove_packaging_data_files code rootfs_ipk.bbclass: Some extra spaces / tabs were removed / formated

 meta/classes/rootfs_ipk.bbclass                    |    8 +++---
 meta/recipes-devtools/opkg-utils/opkg-utils_git.bb |    4 +--
 ...t-add-recommends-pkgs-to-depended-upon-by.patch |   26 ++++++++++++++++++++
 ...n-t-print-provides-if-nothing-is-provided.patch |   24 ++++++++++++++++++
 meta/recipes-devtools/opkg/opkg_svn.bb             |    4 ++-
 5 files changed, 59 insertions(+), 7 deletions(-)
 create mode 100644 meta/recipes-devtools/opkg/opkg/don-t-add-recommends-pkgs-to-depended-upon-by.patch
 create mode 100644 meta/recipes-devtools/opkg/opkg/don-t-print-provides-if-nothing-is-provided.patch
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH v2 1/5 opkg-utils: Add needed python modules as RDEPENDS

---
 meta/recipes-devtools/opkg-utils/opkg-utils_git.bb |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
meta/recipes-devtools/opkg-utils/opkg-utils_git.bb +2 -2
index 92e6624..825c927 100644
@@ -4,11 +4,11 @@ HOMEPAGE = "http://wiki.openmoko.org/wiki/Opkg"
 LICENSE = "GPLv2+"
 LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
                     file://opkg.py;beginline=1;endline=18;md5=15917491ad6bf7acc666ca5f7cc1e083"
-RDEPENDS_${PN} = "python"
+RDEPENDS_${PN} = "python python-shell python-io python-math python-crypt python-logging python-fcntl python-subprocess python-pickle python-compression python-textutils python-stringold"
 RDEPENDS_${PN}_virtclass-native = ""
 SRCREV = "49cc783d8e0415059d126ae22c892988717ffda7"
 PV = "0.1.8+git${SRCPV}"
-PR = "r0"
+PR = "r1"
 
 SRC_URI = "git://git.yoctoproject.org/opkg-utils;protocol=git \
            "
Signature · 1 line
1.7.9.5
#2 lore raw

PATCH v2 2/5 opkg: Add patch to fix removing packages with recommends

While removing a package with opkg, the process shouldn't be blocked if another package RECOMMENDS the package wanted to be removed. This is because, while generating the dependencies, opkg adds dependencies to depended_upon_by even if dependency's type is RECOMMEND. The fix is to skip dependencies of type RECOMMEND while constructing depended_upon_by.

[YOCTO: #2431]

---
 ...t-add-recommends-pkgs-to-depended-upon-by.patch |   26 ++++++++++++++++++++
 meta/recipes-devtools/opkg/opkg_svn.bb             |    1 +
 2 files changed, 27 insertions(+)
 create mode 100644 meta/recipes-devtools/opkg/opkg/don-t-add-recommends-pkgs-to-depended-upon-by.patch
meta/recipes-devtools/opkg/opkg/don-t-add-recommends-pkgs-to-depended-upon-by.patch new file +26 -0
new file mode 100644
index 0000000..e581dc0
@@ -0,0 +1,26 @@
+While removing a package with opkg, the process shouldn't be blocked if
+another package RECOMMENDS the package wanted to be removed. This is
+because, while generating the dependencies, opkg adds dependencies to
+depended_upon_by even if dependency's type is RECOMMEND. The fix is to
+skip dependencies of type RECOMMEND while constructing depended_upon_by.
+
+Bug info:
+https://bugzilla.yoctoproject.org/show_bug.cgi?id=2431
+
+Upstream-Status: Pending
+Signed-off-by: Andrei Gherzan <[email protected]>
+
+Index: trunk/libopkg/pkg_depends.c
+===================================================================
+--- trunk.orig/libopkg/pkg_depends.c	2011-09-03 05:54:56.000000000 +0300
++++ trunk/libopkg/pkg_depends.c	2012-10-20 22:23:03.783573202 +0300
+@@ -785,8 +785,7 @@
+ 	for (i = 0; i < count; i++) {
+ 		depends = &pkg->depends[i];
+ 		if (depends->type != PREDEPEND
+-		    && depends->type != DEPEND
+-		    && depends->type != RECOMMEND)
++		    && depends->type != DEPEND)
+ 			continue;
+ 		for (j = 0; j < depends->possibility_count; j++) {
+ 			ab_depend = depends->possibilities[j]->pkg;
meta/recipes-devtools/opkg/opkg_svn.bb +1 -0
index 4e83cfb..3a90677 100644
@@ -12,6 +12,7 @@ SRC_URI = "svn://opkg.googlecode.com/svn;module=trunk;protocol=http \
   file://0009-pkg_depends-fix-version-constraints.patch \
   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 \
 "
 
 S = "${WORKDIR}/trunk"
Signature · 1 line
1.7.9.5
#3 lore raw

PATCH v2 3/5 opkg: Don't print empty PROVIDES

In reply to Andrei Gherzan

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.

---
 ...n-t-print-provides-if-nothing-is-provided.patch |   24 ++++++++++++++++++++
 meta/recipes-devtools/opkg/opkg_svn.bb             |    3 ++-
 2 files changed, 26 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-devtools/opkg/opkg/don-t-print-provides-if-nothing-is-provided.patch
meta/recipes-devtools/opkg/opkg/don-t-print-provides-if-nothing-is-provided.patch new file +24 -0
new file mode 100644
index 0000000..669faef
@@ -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 <[email protected]>
+
+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 ? "" : ",",
meta/recipes-devtools/opkg/opkg_svn.bb +2 -1
index 3a90677..e1049a7 100644
@@ -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"
Signature · 1 line
1.7.9.5
#4 lore raw

PATCH v2 4/5 rootfs_ipk.bbclass: Don't duplicate remove_packaging_data_files code

In reply to Andrei Gherzan

While removing packaging data files in rootfs_ipk_do_rootfs use the remove_packaging_data_files function. By using this function we ensure that /var/lib/opkg directory is created. opkg needs this directory to create lock files.

---
 meta/classes/rootfs_ipk.bbclass |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/rootfs_ipk.bbclass +1 -1
index 9d716fb..25f15ee 100644
@@ -111,7 +111,7 @@ fakeroot rootfs_ipk_do_rootfs () {
 			fi
 
 			# Also delete the status files
-			rm -rf ${IMAGE_ROOTFS}${opkglibdir}
+			remove_packaging_data_files
 		fi
 	fi
 	set +x
Signature · 1 line
1.7.9.5
#5 lore raw

PATCH v2 5/5 rootfs_ipk.bbclass: Some extra spaces / tabs were removed / formated

In reply to Andrei Gherzan
---
 meta/classes/rootfs_ipk.bbclass |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
meta/classes/rootfs_ipk.bbclass +3 -3
index 25f15ee..f69cc0e 100644
@@ -115,7 +115,7 @@ fakeroot rootfs_ipk_do_rootfs () {
 		fi
 	fi
 	set +x
-	log_check rootfs 	
+	log_check rootfs
 }
 
 rootfs_ipk_write_manifest() {
@@ -134,8 +134,8 @@ rootfs_ipk_write_manifest() {
 
 remove_packaging_data_files() {
 	rm -rf ${IMAGE_ROOTFS}${opkglibdir}
-        # We need the directory for the package manager lock
-        mkdir ${IMAGE_ROOTFS}${opkglibdir}
+	# We need the directory for the package manager lock
+	mkdir ${IMAGE_ROOTFS}${opkglibdir}
 }
 
 list_installed_packages() {
Signature · 1 line
1.7.9.5
Applied
#7 lore raw
In reply to Andrei Gherzan
Quoted 8 lines · Andrei Gherzan

V2:
Have rootfs_ipk.bbclass formatting changings in a different commit.
Thanks: Otavio Salvador <[email protected]>

The following changes since commit caba9cbfce09f19eb27f4c6615c0c5c48e1a2952:

   kernel.bbclass: add kernel-modules to PACKAGES (2012-10-19 23:06:26 +0100)
Quoted 7 lines

are available in the git repository at:

git://git.yoctoproject.org/poky-contrib ag/opkg
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=ag/opkg

Andrei Gherzan (5):
opkg-utils: Add needed python modules as RDEPENDS

This one was not merged

Quoted 5 lines

opkg: Add patch to fix removing packages with recommends
opkg: Don't print empty PROVIDES
rootfs_ipk.bbclass: Don't duplicate remove_packaging_data_files code rootfs_ipk.bbclass: Some extra spaces / tabs were removed / formated

Merged into OE-Core

Thanks
Sau!

Quoted 9 lines
  meta/classes/rootfs_ipk.bbclass                    |    8 +++---
  meta/recipes-devtools/opkg-utils/opkg-utils_git.bb |    4 +--
  ...t-add-recommends-pkgs-to-depended-upon-by.patch |   26 ++++++++++++++++++++
  ...n-t-print-provides-if-nothing-is-provided.patch |   24 ++++++++++++++++++
  meta/recipes-devtools/opkg/opkg_svn.bb             |    4 ++-
  5 files changed, 59 insertions(+), 7 deletions(-)

create mode 100644 meta/recipes-devtools/opkg/opkg/don-t-add-recommends-pkgs-to-depended-upon-by.patch create mode 100644 meta/recipes-devtools/opkg/opkg/don-t-print-provides-if-nothing-is-provided.patch