summaryrefslogtreecommitdiffstats
path: root/src/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd')
-rw-r--r--src/cmd/build.sh26
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