浏览代码

utils/brmake: drop use of unbuffer

When it was introduced in afdb545b2847 (tools: new tool to filter the
output of make), brmake made use of unbuffer, so as to try and ensure
that no output would get lost between make printing it, and the logger
loop time-stamping it and storing it in the logfile, in case the user
would interrup the build (SIGINT, ^C)

However, unbuffer is missing in our reference build image (we could have
added it, but we missed the occasion to do so every time we updated the
reference build image).

Furthermore, the rationale for using unbuffer, although reasonable, is
not so practical: indeed, when the user hits Crtl-C, this is inherently
asynchronous, and they can't expect everything to be entirely cleanly
terminated, especially buffering. Using unbuffer is thus slightly
superfluous.

The timestamps will be slightly off because of buffering, but a build
generates so much output that this won't be a problem in practice.

Drop use of unbuffer.

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>
Yann E. MORIN 5 月之前
父节点
当前提交
3aacb38098
共有 1 个文件被更改,包括 1 次插入6 次删除
  1. 1 6
      utils/brmake

+ 1 - 6
utils/brmake

@@ -5,11 +5,6 @@
 main() {
     local ret start d h m mf
 
-    if ! which unbuffer >/dev/null 2>&1; then
-        printf "you need to install 'unbuffer' (from package expect or expect-dev)\n" >&2
-        exit 1
-    fi
-
     start=${SECONDS}
 
     if [ -n "$BR2_DOCKER" ]; then
@@ -18,7 +13,7 @@ main() {
         docker=()
     fi
 
-    ( exec 2>&1; unbuffer "${docker[@]}" make "${@}"; ) \
+    ( exec 2>&1; "${docker[@]}" make "${@}"; ) \
     > >( while read -r line; do
              printf "%(%Y-%m-%dT%H:%M:%S)T %s\n" -1 "${line}"
          done \