diff options
author | P. J. McDermott <pjm@nac.net> | 2012-11-14 22:05:32 (EST) |
---|---|---|
committer | P. J. McDermott <pjm@nac.net> | 2012-11-14 22:05:32 (EST) |
commit | 16264c1877a8df3edca8082db116fc9e68fc9c84 (patch) | |
tree | 081be9bcd8aeef8762707f5f431b49588eb28914 /src | |
parent | c900074b320501a82b1cc2ef0ce37a5c0894a947 (diff) |
Add some more error handling to opkbuild.
Diffstat (limited to 'src')
-rw-r--r-- | src/opkbuild.sh | 49 |
1 files changed, 37 insertions, 12 deletions
diff --git a/src/opkbuild.sh b/src/opkbuild.sh index 057ac9a..d72fc60 100644 --- a/src/opkbuild.sh +++ b/src/opkbuild.sh @@ -75,7 +75,11 @@ main() if [ "${opt_build}" != 'source' ]; then print_arch_stats - "${opt_check_build_deps}" && '@@BINDIR@@/ob-checkbuilddeps' + if "${opt_check_build_deps}"; then + if ! '@@BINDIR@@/ob-checkbuilddeps'; then + exit 1 + fi + fi setup_build build clean @@ -274,8 +278,12 @@ build_source() esac done - OB_DO_SOURCE='true' '@@BINDIR@@/ob-gencontrol' - OB_DO_SOURCE='true' '@@BINDIR@@/ob-buildopk' + if ! OB_DO_SOURCE='true' '@@BINDIR@@/ob-gencontrol'; then + exit 1 + fi + if ! OB_DO_SOURCE='true' '@@BINDIR@@/ob-buildopk'; then + exit 1 + fi rm -Rf "src-${src}.data" || ob_error "$(ob_get_msg 'cant_rm_src_pkg_data')" } @@ -299,9 +307,16 @@ setup_build() eval "$('@@BINDIR@@/ob-buildenv' | sed 's/^/export /')" - '@@BINDIR@@/ob-unpacksource' - '@@BINDIR@@/ob-applypatches' - '@@BINDIR@@/ob-installplatconf' + if ! '@@BINDIR@@/ob-unpacksource'; then + exit 1 + fi + if ! '@@BINDIR@@/ob-applypatches'; then + # TODO: Remove the ":" after fixing ob-applypatches. + : exit 1 + fi + if ! '@@BINDIR@@/ob-installplatconf'; then + exit 1 + fi } build() @@ -310,21 +325,31 @@ build() '') ../build build ${opt_uid0_cmd} sh -s <<-EOF - ../build install - '@@BINDIR@@/ob-installdocs' - '@@BINDIR@@/ob-gencontrol' + ../build install && \ + '@@BINDIR@@/ob-installdocs' && \ + '@@BINDIR@@/ob-gencontrol' && \ '@@BINDIR@@/ob-buildopk' EOF + if [ ${?} -ne 0 ]; then + exit 1 + fi ;; 'install'|'install-'*) - ${opt_uid0_cmd} ../build "${opt_target}" + if ! ${opt_uid0_cmd} ../build "${opt_target}"; then + exit 1 + fi ;; *) - ../build "${opt_target}" + if ! ../build "${opt_target}"; then + exit 1 + fi ;; esac - : '@@BINDIR@@/ob-genchanges' + # TODO: Remove the ":" when ob-genchanges is implemented. + if ! : '@@BINDIR@@/ob-genchanges'; then + exit 1 + fi } clean() |