From a3b45a082d7076a46ad5288c2d6728c289e6d479 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Sun, 22 Apr 2012 17:06:43 -0400 Subject: Support new '-a' option and use GNU terms. --- (limited to 'src') diff --git a/src/opkbuild.sh b/src/opkbuild.sh index 8658ed5..9397fb3 100644 --- a/src/opkbuild.sh +++ b/src/opkbuild.sh @@ -25,7 +25,9 @@ print_usage() { - printf 'Usage: %s [-r assume-uid0-cmd] [-p target-platform] [-d]\n' "${1}" + cat <&2 + 'Multiple platforms found while detecting host' >&2 exit 1 fi # ... and there are config files and one installable platform, build for it. fi -# Attempt to detect the target architecture tuple. -# NB: Currently cross-compiling is not supported. -arch=$(opkg print-architecture | sed -n \ - 's/^arch \([^ -][^ -]*-[^ -][^ -]*-[^ -][^ -]*\) [0-9][0-9]*$/\1/p') +# If a host architecture is not specified ... if [ -z "${arch}" ]; then - printf 'opkbuild: Error: No installable architecture found\n' >&2 - exit 1 -elif [ $(echo "${arch}" | wc -l) -gt 1 ]; then - printf 'opkbuild: Error: Multiple installable architectures found\n' >&2 - exit 1 + # Attempt to detect the host architecture tuple. + 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 + exit 1 + elif [ $(echo "${arch}" | wc -l) -gt 1 ]; then + printf 'opkbuild: Error: Multiple installable architectures found\n' >&2 + exit 1 + fi fi # Resolve status override file path. -- cgit v0.9.1