diff options
author | P. J. McDermott <pj@pehjota.net> | 2014-10-07 09:12:12 (EDT) |
---|---|---|
committer | P. J. McDermott <pj@pehjota.net> | 2014-10-07 09:12:12 (EDT) |
commit | 736382ad750e6fa0cf49181cd21c81500487c898 (patch) | |
tree | 76f3cf5154135d09f0aaf01149c52a2e67ed03e4 | |
parent | 90f7528ca50875d053864b640d9dca56475e0d51 (diff) |
cmd/build: Split heredoc into up to three shells
This might be slightly less efficient, but the code looks a little nicer
and any whitespace in arguments to opkbuild is preserved.
-rw-r--r-- | lib/cmd/build.sh | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/lib/cmd/build.sh b/lib/cmd/build.sh index 317ce5a..2a7f5d2 100644 --- a/lib/cmd/build.sh +++ b/lib/cmd/build.sh @@ -86,19 +86,17 @@ cmd_build_main() build_deps="$(package_get_build_deps "${arch}" "${plat}")" if [ "x${build_deps}" != 'x' ]; then cmd_build_make_deps_pkg "${root}" "${build_deps}" + session_exec opkg install ../builddeps.opk fi - session_exec sh <<-EOF - if [ 'x${build_deps}' != 'x' ]; then - opkg install ../builddeps.opk - fi - opkbuild ${@} - if [ 'x${build_deps}' != 'x' ]; then - opkg --autoremove remove prokit-builddeps-$(session_id) - fi - EOF + session_exec opkbuild "${@}" + + if [ "x${build_deps}" != 'x' ]; then + session_exec opkg --autoremove remove \ + prokit-builddeps-$(session_id) + rm "${root}${session_dir}/builddeps.opk" + fi - rm -f "${root}${session_dir}/builddeps.opk" for f in "${root}${session_dir}/"*; do [ -e "${f}" ] || continue [ "x${f##*/}" = 'xwd' ] && continue |