From 1ad80db073a2296e7853b8e958c7dbab228cd699 Mon Sep 17 00:00:00 2001 From: Lucas Werkmeister Date: Sat, 5 Jan 2019 15:04:17 +0100 Subject: [PATCH] fix: correct non-interactive forcing of apt commands MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Change I8998df2b44 (commit 58c1a7f1b0) changed these apt commands to pipe into `cat` so that they will use non-interactive output. However, not only was the use of a dedicated subshell and `cat` per command wasteful, it also introduced a bug – in a pipeline, only the exit status of the last component matters (unless `set -o pipefail` is in effect): $ ( false | cat ) && echo 'This still runs.' This still runs. Change-Id: I22e76749faeec7589e1a4353c6d23db31070daf3 --- manager/setup | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manager/setup b/manager/setup index 0c5643b..7f38205 100755 --- a/manager/setup +++ b/manager/setup @@ -36,7 +36,7 @@ function reset_vm { } function update { title 'S1: apt-get; clone' - ssh_target -t "( sudo apt-get update | cat ) && ( DEBIAN_FRONTEND=noninteractive sudo -E apt-get upgrade -o Dpkg::Options::=\"--force-confold\" -y | cat ) && ( sudo apt-get install -y git curl $devPkgs | cat )" + ssh_target -t "{ sudo apt-get update && DEBIAN_FRONTEND=noninteractive sudo -E apt-get upgrade -o Dpkg::Options::=\"--force-confold\" -y && sudo apt-get install -y git curl $devPkgs; } | cat" echo "Git init" ssh_target -t '[[ -d .git ]] || git init;' echo "Git push" -- 2.39.2