* || true is needed for cases where grep doesn't find anything
* and quotes around info are needed to keep line breaks

Signed-off-by: Martin Jansa <[email protected]>
---
 meta/classes/rootfs_ipk.bbclass |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/meta/classes/rootfs_ipk.bbclass b/meta/classes/rootfs_ipk.bbclass
index 2df8ca4..13bd4bf 100644
--- a/meta/classes/rootfs_ipk.bbclass
+++ b/meta/classes/rootfs_ipk.bbclass
@@ -127,9 +127,10 @@ list_installed_packages() {
 }
 
 get_package_filename() {
-       name=`opkg-cl ${IPKG_ARGS} info $1 | grep -B 7 -A 7 "^Status.* 
\(\(installed\)\|\(unpacked\)\)" | awk '/^Package/ {printf $2"_"}'`
-       name=$name`opkg-cl ${IPKG_ARGS} info $1 | grep -B 7 -A 7 "^Status.* 
\(\(installed\)\|\(unpacked\)\)" | awk -F: '/^Version/ {printf $NF"_"}' | sed 
's/^\s*//g'`
-       name=$name`opkg-cl ${IPKG_ARGS} info $1 | grep -B 7 -A 7 "^Status.* 
\(\(installed\)\|\(unpacked\)\)" | awk '/^Archi/ {print $2".ipk"}'`
+       info=`opkg-cl ${IPKG_ARGS} info $1 | grep -B 7 -A 7 "^Status.* 
\(\(installed\)\|\(unpacked\)\)" || true`
+       name=`echo "${info}" | awk '/^Package/ {printf $2"_"}'`
+       name=$name`echo "${info}" | awk -F: '/^Version/ {printf $NF"_"}' | sed 
's/^\s*//g'`
+       name=$name`echo "${info}" | awk '/^Archi/ {print $2".ipk"}'`
 
        fullname=`find ${DEPLOY_DIR_IPK} -name "$name" || true`
        if [ "$fullname" = "" ] ; then
-- 
1.7.8.5


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

Reply via email to