diff options
author | P. J. McDermott <pjm@nac.net> | 2012-01-29 21:22:37 (EST) |
---|---|---|
committer | P. J. McDermott <pjm@nac.net> | 2012-01-29 21:22:37 (EST) |
commit | ecbf297b450bceecd7907c880c48d4f381d73a3d (patch) | |
tree | ff4771c4694bd9d6ae76495d94687e76054a519a /src/opkbuild | |
parent | d42d90bbc4c17d223629a1175dc5ca4e77026ec9 (diff) |
Fix detection of target architecture and platform.
Diffstat (limited to 'src/opkbuild')
-rw-r--r-- | src/opkbuild | 6 |
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 |