Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH] Add support for BAD_RECOMMENDATIONS to rootfs_ipk
@ 2011-06-30 11:10 Chris Elston
  2011-06-30 23:13 ` Saul Wold
  0 siblings, 1 reply; 9+ messages in thread
From: Chris Elston @ 2011-06-30 11:10 UTC (permalink / raw)
  To: openembedded-core

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(-)

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}"
-- 
1.6.2.5






^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH] Add support for BAD_RECOMMENDATIONS to rootfs_ipk
  2011-06-30 11:10 [PATCH] Add support for BAD_RECOMMENDATIONS to rootfs_ipk Chris Elston
@ 2011-06-30 23:13 ` Saul Wold
  2011-07-01  9:06   ` Chris Elston
  0 siblings, 1 reply; 9+ messages in thread
From: Saul Wold @ 2011-06-30 23:13 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

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}"



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Add support for BAD_RECOMMENDATIONS to rootfs_ipk
  2011-06-30 23:13 ` Saul Wold
@ 2011-07-01  9:06   ` Chris Elston
  2011-07-01  9:20     ` Phil Blundell
  0 siblings, 1 reply; 9+ messages in thread
From: Chris Elston @ 2011-07-01  9:06 UTC (permalink / raw)
  To: Saul Wold; +Cc: Patches and discussions about the oe-core layer

On Thu, 2011-06-30 at 16:13 -0700, Saul Wold wrote:
> 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!

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.

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}"
-- 
1.6.2.5




^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH] Add support for BAD_RECOMMENDATIONS to rootfs_ipk
  2011-07-01  9:06   ` Chris Elston
@ 2011-07-01  9:20     ` Phil Blundell
  2011-07-06 22:25       ` Saul Wold
  0 siblings, 1 reply; 9+ messages in thread
From: Phil Blundell @ 2011-07-01  9:20 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

On Fri, 2011-07-01 at 10:06 +0100, Chris Elston wrote:
> +	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.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Add support for BAD_RECOMMENDATIONS to rootfs_ipk
  2011-07-01  9:20     ` Phil Blundell
@ 2011-07-06 22:25       ` Saul Wold
  2011-07-11  8:53         ` Chris Elston
  0 siblings, 1 reply; 9+ messages in thread
From: Saul Wold @ 2011-07-06 22:25 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

On 07/01/2011 02:20 AM, Phil Blundell wrote:
> On Fri, 2011-07-01 at 10:06 +0100, Chris Elston wrote:
>> +	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!

>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
>



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Add support for BAD_RECOMMENDATIONS to rootfs_ipk
  2011-07-06 22:25       ` Saul Wold
@ 2011-07-11  8:53         ` Chris Elston
  2011-07-11  9:00           ` Phil Blundell
  0 siblings, 1 reply; 9+ messages in thread
From: Chris Elston @ 2011-07-11  8:53 UTC (permalink / raw)
  To: Saul Wold; +Cc: Patches and discussions about the oe-core layer

On Wed, 2011-07-06 at 15:25 -0700, Saul Wold wrote:
> On 07/01/2011 02:20 AM, Phil Blundell wrote:
> > On Fri, 2011-07-01 at 10:06 +0100, Chris Elston wrote:
> >> +	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!

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.

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}${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}"
-- 
1.6.2.5




^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH] Add support for BAD_RECOMMENDATIONS to rootfs_ipk
  2011-07-11  8:53         ` Chris Elston
@ 2011-07-11  9:00           ` Phil Blundell
  2011-07-11 12:14             ` Chris Elston
  0 siblings, 1 reply; 9+ messages in thread
From: Phil Blundell @ 2011-07-11  9:00 UTC (permalink / raw)
  To: celston; +Cc: Patches and discussions about the oe-core layer

On Mon, 2011-07-11 at 09:53 +0100, Chris Elston wrote:
> +       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.

> +       # 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

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.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Add support for BAD_RECOMMENDATIONS to rootfs_ipk
  2011-07-11  9:00           ` Phil Blundell
@ 2011-07-11 12:14             ` Chris Elston
  2011-07-12 14:02               ` Richard Purdie
  0 siblings, 1 reply; 9+ messages in thread
From: Chris Elston @ 2011-07-11 12:14 UTC (permalink / raw)
  To: Phil Blundell; +Cc: Patches and discussions about the oe-core layer

On Mon, 2011-07-11 at 10:00 +0100, Phil Blundell wrote:
> On Mon, 2011-07-11 at 09:53 +0100, Chris Elston wrote:
> > +       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.
> 
> > +       # 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
> 
> 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.

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

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

diff --git a/meta/classes/rootfs_ipk.bbclass b/meta/classes/rootfs_ipk.bbclass
index edd84fb..1540432 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
 
@@ -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}"
-- 
1.6.2.5




^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH] Add support for BAD_RECOMMENDATIONS to rootfs_ipk
  2011-07-11 12:14             ` Chris Elston
@ 2011-07-12 14:02               ` Richard Purdie
  0 siblings, 0 replies; 9+ messages in thread
From: Richard Purdie @ 2011-07-12 14:02 UTC (permalink / raw)
  To: celston, Patches and discussions about the oe-core layer

On Mon, 2011-07-11 at 13:14 +0100, 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.
> 
> Signed-off-by: Chris Elston <celston@katalix.com>

Merged to master, thanks.

Richard




^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2011-07-12 14:06 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-30 11:10 [PATCH] Add support for BAD_RECOMMENDATIONS to rootfs_ipk Chris Elston
2011-06-30 23:13 ` Saul Wold
2011-07-01  9:06   ` Chris Elston
2011-07-01  9:20     ` Phil Blundell
2011-07-06 22:25       ` Saul Wold
2011-07-11  8:53         ` Chris Elston
2011-07-11  9:00           ` Phil Blundell
2011-07-11 12:14             ` Chris Elston
2011-07-12 14:02               ` Richard Purdie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox