summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/opkbuild6
1 files changed, 4 insertions, 2 deletions
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