Skip to contentSkip to conversation

Add support for BAD_RECOMMENDATIONS to rootfs_ipk

PATCH Applied Chris Elston 4 participants 9 messages Jun 30, 2011 – Jul 12, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Add support for BAD_RECOMMENDATIONS to rootfs_ipk

As discussed on IRC on 30/06/11, this patch adds support for BAD_RECOMMENDATIONS to rootfs_ipk, which is a list of packages NOT to install if suggested or recommended by a recipe. Taken from
http://thread.gmane.org/gmane.comp.handhelds.openembedded/30417.

Note that current support for this in oe.dev may also be broken, depending on the version of opkg in use.

---
 meta/classes/rootfs_ipk.bbclass |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)
(quoted diff) +0 -0

b/meta/classes/rootfs_ipk.bbclass
index edd84fb..bf15f4c 100644

meta/classes/rootfs_ipk.bbclass +11 -0
@@ -20,6 +20,9 @@ OPKG_POSTPROCESS_COMMANDS = "ipk_insert_feed_uris"
 
 opkglibdir = "${localstatedir}/lib/opkg"
 
+# Which packages to not install on the basis of a recommendation
+BAD_RECOMMENDATIONS ?= ""
+
 fakeroot rootfs_ipk_do_rootfs () {
 	set -x
 
@@ -30,6 +33,21 @@ fakeroot rootfs_ipk_do_rootfs () {
 
 	mkdir -p ${T}/
 
+	STATUS=${IMAGE_ROOTFS}/var/lib/opkg/status
+	mkdir -p `dirname ${STATUS}`
+
+	opkg-cl ${IPKG_ARGS} update
+
+	# prime the status file with bits that we don't want
+	for i in ${BAD_RECOMMENDATIONS}; do
+		infln="`opkg-cl ${IPKG_ARGS} info $i | grep -e '^Package:' -e

'^Architecture:' -e '^Version:'`"
+ if [ ! -z "$infln" ]; then
+ echo "$infln" >> $STATUS
+ echo "Status: deinstall ok not-installed" >> $STATUS
+ echo >> $STATUS
+ fi
+ done
+
#install
export
INSTALL_PACKAGES_ATTEMPTONLY_IPK="${PACKAGE_INSTALL_ATTEMPTONLY}"
export INSTALL_PACKAGES_LINGUAS_IPK="${LINGUAS_INSTALL}"

Signature · 1 line
1.6.2.5
#1 lore raw
Quoted 8 lines · Chris Elston

As discussed on IRC on 30/06/11, this patch adds support for BAD_RECOMMENDATIONS to rootfs_ipk, which is a list of packages NOT to install if suggested or recommended by a recipe. Taken from
http://thread.gmane.org/gmane.comp.handhelds.openembedded/30417.

Note that current support for this in oe.dev may also be broken, depending on the version of opkg in use.

This patch does not seem to apply cleanly, could you please rebase and resend.

Thanks

Sau!

Quoted 45 lines
---
  meta/classes/rootfs_ipk.bbclass |   18 ++++++++++++++++++
  1 files changed, 18 insertions(+), 0 deletions(-)
meta/classes/rootfs_ipk.bbclass +11 -0
index edd84fb..bf15f4c 100644
@@ -20,6 +20,9 @@ OPKG_POSTPROCESS_COMMANDS = "ipk_insert_feed_uris"
 
  opkglibdir = "${localstatedir}/lib/opkg"
 
+# Which packages to not install on the basis of a recommendation
+BAD_RECOMMENDATIONS ?= ""
+
  fakeroot rootfs_ipk_do_rootfs () {
  	set -x
 
@@ -30,6 +33,21 @@ fakeroot rootfs_ipk_do_rootfs () {
 
  	mkdir -p ${T}/
 
+	STATUS=${IMAGE_ROOTFS}/var/lib/opkg/status
+	mkdir -p `dirname ${STATUS}`
+
+	opkg-cl ${IPKG_ARGS} update
+
+	# prime the status file with bits that we don't want
+	for i in ${BAD_RECOMMENDATIONS}; do
+		infln="`opkg-cl ${IPKG_ARGS} info $i | grep -e '^Package:' -e

'^Architecture:' -e '^Version:'`"

meta/classes/rootfs_ipk.bbclass +7 -0
+		if [ ! -z "$infln" ]; then
+			echo "$infln">>  $STATUS
+			echo "Status: deinstall ok not-installed">>  $STATUS
+			echo>>  $STATUS
+		fi
+ 	done
+
  	#install
  	export

INSTALL_PACKAGES_ATTEMPTONLY_IPK="${PACKAGE_INSTALL_ATTEMPTONLY}"
export INSTALL_PACKAGES_LINGUAS_IPK="${LINGUAS_INSTALL}"

#2 lore raw
Quoted 9 lines · Saul Wold
Quoted 8 lines · Chris Elston

As discussed on IRC on 30/06/11, this patch adds support for BAD_RECOMMENDATIONS to rootfs_ipk, which is a list of packages NOT to install if suggested or recommended by a recipe. Taken from
http://thread.gmane.org/gmane.comp.handhelds.openembedded/30417.

Note that current support for this in oe.dev may also be broken, depending on the version of opkg in use.

Quoted 6 lines

This patch does not seem to apply cleanly, could you please rebase and resend.

Thanks

Sau!

Saul,

Apologies, mail client formatting issue. The following should work:

As discussed on IRC on 30/06/11, this patch adds support for BAD_RECOMMENDATIONS to rootfs_ipk, which is a list of packages NOT to install if suggested or recommended by a recipe. Taken from
http://thread.gmane.org/gmane.comp.handhelds.openembedded/30417.

Note that current support for this in oe.dev may also be broken, depending on the version of opkg in use.

---
 meta/classes/rootfs_ipk.bbclass |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)
meta/classes/rootfs_ipk.bbclass +18 -0
index edd84fb..bf15f4c 100644
@@ -20,6 +20,9 @@ OPKG_POSTPROCESS_COMMANDS = "ipk_insert_feed_uris"
 
 opkglibdir = "${localstatedir}/lib/opkg"
 
+# Which packages to not install on the basis of a recommendation
+BAD_RECOMMENDATIONS ?= ""
+
 fakeroot rootfs_ipk_do_rootfs () {
 	set -x
 
@@ -30,6 +33,21 @@ fakeroot rootfs_ipk_do_rootfs () {
 
 	mkdir -p ${T}/
 
+	STATUS=${IMAGE_ROOTFS}/var/lib/opkg/status
+	mkdir -p `dirname ${STATUS}`
+
+	opkg-cl ${IPKG_ARGS} update
+
+	# prime the status file with bits that we don't want
+	for i in ${BAD_RECOMMENDATIONS}; do
+		infln="`opkg-cl ${IPKG_ARGS} info $i | grep -e '^Package:' -e '^Architecture:' -e '^Version:'`"
+		if [ ! -z "$infln" ]; then
+			echo "$infln" >> $STATUS
+			echo "Status: deinstall ok not-installed" >> $STATUS
+			echo >> $STATUS
+		fi
+ 	done
+
 	#install
 	export INSTALL_PACKAGES_ATTEMPTONLY_IPK="${PACKAGE_INSTALL_ATTEMPTONLY}"
 	export INSTALL_PACKAGES_LINGUAS_IPK="${LINGUAS_INSTALL}"
Signature · 1 line
1.6.2.5
#3 lore raw

meta/classes/rootfs_ipk.bbclass fakeroot rootfs_ipk_do_rootfs () { · line 36

Quoted 1 line · Chris Elston
meta/classes/rootfs_ipk.bbclass +1 -0
+	STATUS=${IMAGE_ROOTFS}/var/lib/opkg/status

Please make that use ${opkglibdir} like the rest of the class does. Otherwise this patch looks pretty good to me.

p.

#4 lore raw
Quoted 9 lines · Phil Blundell

meta/classes/rootfs_ipk.bbclass fakeroot rootfs_ipk_do_rootfs () { · line 36

Quoted 1 line · Chris Elston
meta/classes/rootfs_ipk.bbclass +1 -0
+	STATUS=${IMAGE_ROOTFS}/var/lib/opkg/status

Please make that use ${opkglibdir} like the rest of the class does. Otherwise this patch looks pretty good to me.

p.

Chris,

Are you going to republish with this change?

Sau!

Quoted 6 lines

_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core

#5 lore raw
Quoted 7 lines · Saul Wold
Quoted 6 lines · Phil Blundell

Review

Quoted 1 line · Chris Elston
(quoted diff) +1 -0
+	STATUS=${IMAGE_ROOTFS}/var/lib/opkg/status

Please make that use ${opkglibdir} like the rest of the class does. Otherwise this patch looks pretty good to me.

Quoted 8 lines
Quoted 3 lines

p.

Chris,

Are you going to republish with this change?

Sau!

Saul,

Revised with Phil's suggested change:

As discussed on IRC on 30/06/11, this patch adds support for BAD_RECOMMENDATIONS to rootfs_ipk, which is a list of packages NOT to install if suggested or recommended by a recipe. Taken from
http://thread.gmane.org/gmane.comp.handhelds.openembedded/30417.

Note that current support for this in oe.dev may also be broken, depending on the version of opkg in use.

---
 meta/classes/rootfs_ipk.bbclass |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)
(quoted diff) +0 -0

b/meta/classes/rootfs_ipk.bbclass
index edd84fb..bf15f4c 100644

meta/classes/rootfs_ipk.bbclass +11 -0
@@ -20,6 +20,9 @@ OPKG_POSTPROCESS_COMMANDS = "ipk_insert_feed_uris"
 
 opkglibdir = "${localstatedir}/lib/opkg"
 
+# Which packages to not install on the basis of a recommendation
+BAD_RECOMMENDATIONS ?= ""
+
 fakeroot rootfs_ipk_do_rootfs () {
        set -x
 
@@ -30,6 +33,21 @@ fakeroot rootfs_ipk_do_rootfs () {
 
        mkdir -p ${T}/
 
+       STATUS=${IMAGE_ROOTFS}${opkglibdir}/status
+       mkdir -p `dirname ${STATUS}`
+
+       opkg-cl ${IPKG_ARGS} update
+
+       # prime the status file with bits that we don't want
+       for i in ${BAD_RECOMMENDATIONS}; do
+               infln="`opkg-cl ${IPKG_ARGS} info $i | grep -e

'^Package:' -e '^Architecture:' -e '^Version:'`"
+ if [ ! -z "$infln" ]; then
+ echo "$infln" >> $STATUS
+ echo "Status: deinstall ok not-installed" >>
$STATUS
+ echo >> $STATUS
+ fi
+ done
+
#install
export
INSTALL_PACKAGES_ATTEMPTONLY_IPK="${PACKAGE_INSTALL_ATTEMPTONLY}"

        export INSTALL_PACKAGES_LINGUAS_IPK="${LINGUAS_INSTALL}"
Signature · 1 line
1.6.2.5
#6 lore raw

meta/classes/rootfs_ipk.bbclass fakeroot rootfs_ipk_do_rootfs () { · line 37

Quoted 2 lines · Chris Elston
meta/classes/rootfs_ipk.bbclass +2 -0
+       STATUS=${IMAGE_ROOTFS}${opkglibdir}/status
+       mkdir -p `dirname ${STATUS}`

Not that it's a massive deal, but this call to "dirname" is redundant since dirname ${STATUS} is ${IMAGE_ROOTFS}${opkglibdir} by definition.

Review

Quoted 6 lines
meta/classes/rootfs_ipk.bbclass +3 -0
+       # prime the status file with bits that we don't want
+       for i in ${BAD_RECOMMENDATIONS}; do
+               infln="`opkg-cl ${IPKG_ARGS} info $i | grep -e

'^Package:' -e '^Architecture:' -e '^Version:'`"

(quoted diff) +2 -0
+               if [ ! -z "$infln" ]; then
+                       echo "$infln" >> $STATUS

Reading this again I wonder what would happen if one of the packages named in BAD_RECOMMENDATIONS doesn't actually exist. Can you verify that this code does something sensible in that case?

p.

#7 lore raw
Quoted 14 lines · Phil Blundell

Review

Quoted 2 lines · Chris Elston
(quoted diff) +2 -0
+       STATUS=${IMAGE_ROOTFS}${opkglibdir}/status
+       mkdir -p `dirname ${STATUS}`

Not that it's a massive deal, but this call to "dirname" is redundant since dirname ${STATUS} is ${IMAGE_ROOTFS}${opkglibdir} by definition.

Review

Quoted 6 lines
(quoted diff) +3 -0
+       # prime the status file with bits that we don't want
+       for i in ${BAD_RECOMMENDATIONS}; do
+               infln="`opkg-cl ${IPKG_ARGS} info $i | grep -e

'^Package:' -e '^Architecture:' -e '^Version:'`"

(quoted diff) +2 -0
+               if [ ! -z "$infln" ]; then
+                       echo "$infln" >> $STATUS
Quoted 3 lines

Reading this again I wonder what would happen if one of the packages named in BAD_RECOMMENDATIONS doesn't actually exist. Can you verify that this code does something sensible in that case?

You were right, Phil - it did fail in the case that a BAD_RECOMMENDATION didn't exist. Patch updated to take account of that case, and also removed the dirname call.

Saul, resubmission below.

Cheers,

Chris.

---

As discussed on IRC on 30/06/11, this patch adds support for BAD_RECOMMENDATIONS to rootfs_ipk, which is a list of packages NOT to install if suggested or recommended by a recipe. Taken from
http://thread.gmane.org/gmane.comp.handhelds.openembedded/30417.

Note that current support for this in oe.dev may also be broken, depending on the version of opkg in use.

---
 meta/classes/rootfs_ipk.bbclass |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)
meta/classes/rootfs_ipk.bbclass +20 -0
index edd84fb..1540432 100644
@@ -20,6 +20,9 @@ OPKG_POSTPROCESS_COMMANDS = "ipk_insert_feed_uris"
 
 opkglibdir = "${localstatedir}/lib/opkg"
 
+# Which packages to not install on the basis of a recommendation
+BAD_RECOMMENDATIONS ?= ""
+
 fakeroot rootfs_ipk_do_rootfs () {
 	set -x
 
@@ -29,6 +32,23 @@ fakeroot rootfs_ipk_do_rootfs () {
 	${OPKG_PREPROCESS_COMMANDS}
 
 	mkdir -p ${T}/
+ 
+	STATUS=${IMAGE_ROOTFS}${opkglibdir}/status
+	mkdir -p ${IMAGE_ROOTFS}${opkglibdir}
+
+	opkg-cl ${IPKG_ARGS} update
+
+	# prime the status file with bits that we don't want
+	for i in ${BAD_RECOMMENDATIONS}; do
+		pkginfo="`opkg-cl ${IPKG_ARGS} info $i`"
+		if [ ! -z "$pkginfo" ]; then
+			echo "$pkginfo" | grep -e '^Package:' -e '^Architecture:' -e '^Version:' >> $STATUS
+			echo "Status: deinstall ok not-installed" >> $STATUS
+			echo >> $STATUS
+		else
+			echo "Requested ignored recommendation $i is not a package"
+		fi
+	done
 
 	#install
 	export INSTALL_PACKAGES_ATTEMPTONLY_IPK="${PACKAGE_INSTALL_ATTEMPTONLY}"
Signature · 1 line
1.6.2.5
#8 lore raw
Quoted 9 lines · Chris Elston

As discussed on IRC on 30/06/11, this patch adds support for BAD_RECOMMENDATIONS to rootfs_ipk, which is a list of packages NOT to install if suggested or recommended by a recipe. Taken from
http://thread.gmane.org/gmane.comp.handhelds.openembedded/30417.

Note that current support for this in oe.dev may also be broken, depending on the version of opkg in use.

Merged to master, thanks.

Richard