From 2c86da55c77d1150734a1d255928f873752b7dbe Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Sun, 22 Apr 2012 17:07:42 -0400 Subject: Move arch detection before platform detection. --- diff --git a/src/opkbuild.sh b/src/opkbuild.sh index 9397fb3..caa342d 100644 --- a/src/opkbuild.sh +++ b/src/opkbuild.sh @@ -121,6 +121,20 @@ if [ "$(cat format)" != '1.0' ]; then exit 1 fi +# If a host architecture is not specified ... +if [ -z "${arch}" ]; then + # 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 + # Attempt to detect the host platform. # If there no config files to copy, build platform-independent packages. if [ ! -f config ]; then @@ -145,20 +159,6 @@ elif [ -z "${platform}" ]; then # ... and there are config files and one installable platform, build for it. fi -# If a host architecture is not specified ... -if [ -z "${arch}" ]; then - # 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. pkg_dir="${PWD}" cd "$(dirname "${status_override}")" -- cgit v0.9.1