Patchwork Add support for BAD_RECOMMENDATIONS to rootfs_ipk

login
register
mail settings
Submitter Chris Elston
Date June 30, 2011, 11:10 a.m.
Message ID <1309432228.7987.14.camel@desktop.home>
Download mbox | patch
Permalink /patch/6747/
State New, archived
Headers show

Comments

Chris Elston - June 30, 2011, 11:10 a.m.
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.

Signed-off-by: Chris Elston <celston@katalix.com>

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

INSTALL_PACKAGES_ATTEMPTONLY_IPK="${PACKAGE_INSTALL_ATTEMPTONLY}"
 	export INSTALL_PACKAGES_LINGUAS_IPK="${LINGUAS_INSTALL}"
Saul Wold - June 30, 2011, 11:13 p.m.
On 06/30/2011 04:10 AM, Chris Elston wrote:
> 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!

> Signed-off-by: Chris Elston<celston@katalix.com>
>
> ---
>   meta/classes/rootfs_ipk.bbclass |   18 ++++++++++++++++++
>   1 files changed, 18 insertions(+), 0 deletions(-)
>
> diff --git a/meta/classes/rootfs_ipk.bbclass
> b/meta/classes/rootfs_ipk.bbclass
> index edd84fb..bf15f4c 100644
> --- a/meta/classes/rootfs_ipk.bbclass
> +++ b/meta/classes/rootfs_ipk.bbclass
> @@ -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}"

Patch

diff --git a/meta/classes/rootfs_ipk.bbclass
b/meta/classes/rootfs_ipk.bbclass
index edd84fb..bf15f4c 100644
--- a/meta/classes/rootfs_ipk.bbclass
+++ b/meta/classes/rootfs_ipk.bbclass
@@ -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