summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorP. J. McDermott <pjm@nac.net>2012-04-22 17:07:42 (EDT)
committer P. J. McDermott <pjm@nac.net>2012-04-22 17:07:42 (EDT)
commit2c86da55c77d1150734a1d255928f873752b7dbe (patch)
treefc85f227e933481ff0428836327e44d978fcf3e8
parenta3b45a082d7076a46ad5288c2d6728c289e6d479 (diff)
Move arch detection before platform detection.
-rw-r--r--src/opkbuild.sh28
1 files changed, 14 insertions, 14 deletions
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}")"