rootfs_ipk: replace 3 opkg-cl calls with one in get_package_filename

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

(From OE-Core rev: 9a8199e4a0f46ed3e9582143b206144aee28b709)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Martin Jansa 2012-03-23 23:30:49 +01:00 committed by Richard Purdie
parent 46f4df3052
commit c5d91b1170
1 changed files with 4 additions and 3 deletions

View File

@ -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