diff options
author | Patrick McDermott <patrick.mcdermott@libiquity.com> | 2021-01-04 14:09:42 (EST) |
---|---|---|
committer | Patrick McDermott <patrick.mcdermott@libiquity.com> | 2021-01-04 18:47:07 (EST) |
commit | e46bb3d90eec381d33f3280e6caad8a87b0eeddc (patch) | |
tree | a64dbb0419c083d11691cbeb7bc5ae364cf8cff7 /src/cmd | |
parent | 5f448e339d7491bb887fcf74022aec3087991376 (diff) |
cmd/build: Log output
Diffstat (limited to 'src/cmd')
-rw-r--r-- | src/cmd/build.sh | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/src/cmd/build.sh b/src/cmd/build.sh index 021c4aa..733817e 100644 --- a/src/cmd/build.sh +++ b/src/cmd/build.sh @@ -110,6 +110,10 @@ cmd_build_main() local host_plat= local first_arg= local arg= + local source= + local version= + local log= + local tmp_fd= local es= if [ ${#} -lt 2 ]; then @@ -176,8 +180,28 @@ cmd_build_main() return 2 fi + read -r source version <<-EOF + $(package_get_name_and_version) + EOF + log="${_cmd_build_pkg_dir}/../$(: \ + )${source}_${version}_${host_arch}_${host_plat}.log" + + fdalloc + tmp_fd=${FD} es=0 - _cmd_build_build "${host_arch}" "${host_plat}" "${@}" || es=${?} + { + { + { + set +e + _cmd_build_build "${host_arch}" "${host_plat}" \ + "${@}" 2>&1 + printf '%d' ${?} 1>&${tmp_fd} + } | tee "${log}" 1>&2 + } ${tmp_fd}>&1 | { + read es + exit ${es} + } + } 2>&1 || es=${?} session_end |