| Submitter | Chris Elston |
|---|---|
| Date | July 11, 2011, 8:53 a.m. |
| Message ID | <1310374426.10512.3.camel@desktop.home> |
| Download | mbox | patch |
| Permalink | /patch/7301/ |
| State | New, archived |
| Headers | show |
Comments
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.
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}${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