From 736382ad750e6fa0cf49181cd21c81500487c898 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Tue, 07 Oct 2014 09:12:12 -0400 Subject: 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. --- (limited to 'lib') 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 -- cgit v0.9.1