All our documented uses of utils/docker-run, besides running it standalone to get an interactive shell, is to use it as a prefix to the otherwise standard command to run, e.g.: - ./utils/docker-run make foo_defconfig - ./utils/docker-run make menuconfig - ./utils/docker-run make - ./utils/docker-run make check-package Commit8aad67f157(utils/brmake: add option to run in docker) departed from that usual convention, by hiding the call to docker-run inside brmake, conditioned by an environment variable. The only reason is that brmake internally used ubuffer. This is no longer the case, so we can now use brmake together with docker-run in the usual manner. This basically reverts commit8aad67f157, after resolving the conflict due to the removal of unbuffer in te previous commit. Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr> Cc: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Signed-off-by: Arnout Vandecappelle <arnout@mind.be>
38 lines
804 B
Bash
Executable File
38 lines
804 B
Bash
Executable File
#!/bin/bash
|
|
# (C) 2016, "Yann E. MORIN" <yann.morin.1998@free.fr>
|
|
# License: WTFPL, https://spdx.org/licenses/WTFPL.html
|
|
|
|
main() {
|
|
local ret start d h m mf
|
|
|
|
start=${SECONDS}
|
|
|
|
( exec 2>&1; make "${@}" ) \
|
|
> >( while read -r line; do
|
|
printf "%(%Y-%m-%dT%H:%M:%S)T %s\n" -1 "${line}"
|
|
done \
|
|
|tee -a br.log \
|
|
|grep --colour=never -E '>>>'
|
|
)
|
|
ret=${?}
|
|
|
|
d=$((SECONDS-start))
|
|
printf "Done in "
|
|
h=$((d/3600))
|
|
d=$((d%3600))
|
|
[ ${h} -eq 0 ] || { printf "%dh " ${h}; mf="02"; }
|
|
m=$((d/60))
|
|
d=$((d%60))
|
|
[ ${m} -eq 0 ] || { printf "%${mf}dmin " ${m}; sf="02"; }
|
|
printf "%${sf}ds" ${d}
|
|
|
|
if [ ${ret} -ne 0 ]; then
|
|
printf " (error code: %s)" ${ret}
|
|
fi
|
|
printf "\n"
|
|
|
|
return ${ret}
|
|
}
|
|
|
|
main "${@}"
|