summaryrefslogtreecommitdiffstats
path: root/meta/classes/rootfs_ipk.bbclass
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@intel.com>2013-02-19 21:31:52 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-02-19 14:37:44 -0800
commita5362de60c0051f16b88a40bd9cb41915bee0b0f (patch)
tree2efb69b59508ea2dbf514c98d5790c56b1242933 /meta/classes/rootfs_ipk.bbclass
parente7a21cd69a326ab7e2d0e410db28f24956f61208 (diff)
downloadopenembedded-core-a5362de60c0051f16b88a40bd9cb41915bee0b0f.tar.gz
rootfs_ipkg: fix BAD_RECOMMENDATIONS handling
If multiple versions of the same package are in the package feed then the generate status file would only contains a "deinstall" status for the last one, which meant that BAD_RECOMMENDATIONS wouldn't actually work. Use awk instead of grep and stop reading when we reach a newline, so we only ever output a single stanza. Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/rootfs_ipk.bbclass')
-rw-r--r--meta/classes/rootfs_ipk.bbclass10
1 files changed, 7 insertions, 3 deletions
diff --git a/meta/classes/rootfs_ipk.bbclass b/meta/classes/rootfs_ipk.bbclass
index 135bb6026b..a609944e73 100644
--- a/meta/classes/rootfs_ipk.bbclass
+++ b/meta/classes/rootfs_ipk.bbclass
@@ -46,9 +46,13 @@ fakeroot rootfs_ipk_do_rootfs () {
for i in ${BAD_RECOMMENDATIONS}; do
pkginfo="`opkg-cl ${OPKG_ARGS} info $i`"
if [ ! -z "$pkginfo" ]; then
- echo "$pkginfo" | grep -e '^Package:' -e '^Architecture:' -e '^Version:' >> $STATUS
- echo "Status: deinstall hold not-installed" >> $STATUS
- echo >> $STATUS
+ # Take just the first package stanza as otherwise only
+ # the last one will have the right Status line.
+ echo "$pkginfo" | awk "/^Package:/ { print } \
+ /^Architecture:/ { print } \
+ /^Version:/ { print } \
+ /^$/ { exit } \
+ END { print \"Status: deinstall hold not-installed\n\" }" - >> $STATUS
else
echo "Requested ignored recommendation $i is not a package"
fi