From ecbf297b450bceecd7907c880c48d4f381d73a3d Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Sun, 29 Jan 2012 21:22:37 -0500 Subject: Fix detection of target architecture and platform. --- diff --git a/src/opkbuild b/src/opkbuild index b687d4c..e11e078 100644 --- a/src/opkbuild +++ b/src/opkbuild @@ -88,7 +88,8 @@ if [ ! -f config ]; then platform='' # If a target platform was not specified ... elif [ -z "${platform}" ]; then - platform=$(opkg print-architecture | grep -E '^arch [^ -]+ [0-9]+$') + platform=$(opkg print-architecture | \ + sed -n '^s/arch \([^ -][^ -]*\) [0-9][0-9]*$/\1/p') # ... and there are config files and zero installable platforms, fail. if [ -z "${platform}" ]; then printf 'opkbuild: Error: %s\n' \ @@ -106,7 +107,8 @@ fi # Attempt to detect the target architecture tuple. # NB: Currently cross-compiling is not supported. -arch=$(opkg print-architecture | grep -E '^arch [^ -]+(-[^ -]+){3} [0-9]+$') +arch=$(opkg print-architecture | sed -n \ + 's/^arch \([^ -][^ -]*-[^ -][^ -]*-[^ -][^ -]*-[^ -][^ -]*\) [0-9][0-9]*$/\1/p') if [ -z "${arch}" ]; then printf 'opkbuild: Error: No installable architecture found\n' >&2 elif [ $(echo "${arch}" | wc -l) -gt 1 ]; then -- cgit v0.9.1