diff options
author | Patrick McDermott <patrick.mcdermott@libiquity.com> | 2020-06-25 19:20:47 (EDT) |
---|---|---|
committer | Patrick McDermott <patrick.mcdermott@libiquity.com> | 2020-06-25 19:20:47 (EDT) |
commit | c773de28b221c85159e4a715abd25ae7c39bc39c (patch) | |
tree | 629022925f8adf19ac5cd430a61cc3a9d6b16dba | |
parent | c204523a7af08488bedc1b7d06898c4d2da510aa (diff) |
cmd/build: Return exit status
And don't run opkbuild after opkg returns an error.
-rw-r--r-- | NEWS | 5 | ||||
-rw-r--r-- | src/cmd/build.sh | 14 |
2 files changed, 13 insertions, 6 deletions
@@ -8,8 +8,9 @@ Changes in this release: * "prokit build" now passes an "-a" option, if supported, to opkg to install host-architecture non-coinstallable dependencies (such as library development packages) when cross building. - * "prokit shell" and "prokit opkg" now pass through relevant exit - statuses. + * "prokit shell", "prokit opkg", and "prokit build" now pass through + relevant exit statuses. "prokit build" also no longer tries to run + opkbuild after opkg exits with an error. ProteanOS Development Kit version 2.0.1 --------------------------------------- diff --git a/src/cmd/build.sh b/src/cmd/build.sh index 48503b7..4679bc4 100644 --- a/src/cmd/build.sh +++ b/src/cmd/build.sh @@ -77,6 +77,7 @@ cmd_build_main() local plat= local first_arg= local arg= + local es= if [ ${#} -lt 2 ]; then print_cmd_usage 'build' >&2 @@ -141,18 +142,23 @@ cmd_build_main() return 2 fi + es=0 + cmd_build_build_deps="$(package_get_build_deps "${arch}" "${plat}")" if [ "x${cmd_build_build_deps}" != 'x' ]; then _cmd_build_make_deps_pkg if session_exec opkg -a "${arch}" print-architecture \ 1>/dev/null 2>&1; then - session_exec opkg -a "${arch}" install ../builddeps.opk + session_exec opkg -a "${arch}" \ + install ../builddeps.opk || es=${?} else - session_exec opkg install ../builddeps.opk + session_exec opkg install ../builddeps.opk || es=${?} fi fi - session_exec opkbuild "${@}" + if [ ${es} -eq 0 ]; then + session_exec opkbuild "${@}" || es=${?} + fi _cmd_build_fini @@ -160,7 +166,7 @@ cmd_build_main() [ "x${dev}" != 'x' ] && block_umount "${root}" - return 0 + return ${es} } cmd_build_register() |