From 7b1a91dfd3357aa7bbc3ae469effa47ebd0daaa0 Mon Sep 17 00:00:00 2001 From: James Tucker Date: Mon, 25 Jul 2022 15:46:39 -0700 Subject: [PATCH] tool/go: accept a marker file with no line terminator Somewhere my local configuration or program versions are producing marker files earlier in the process that lack a line terminator. This doesn't need to cause an exit via set -e, we can just continue the process. $extracted matches $REV anyway, so the process works. Signed-off-by: James Tucker --- tool/go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tool/go b/tool/go index 8f7485f92..1f31c21df 100755 --- a/tool/go +++ b/tool/go @@ -45,7 +45,9 @@ get_cached() { archive="$TOOLCHAIN-$REV.tar.gz" mark="$TOOLCHAIN.extracted" extracted= - [ ! -e "$mark" ] || read -r extracted junk <$mark + + # Ignore the error from read, which may error if the mark file does not contain a line end. + read -r extracted < "$mark" || true if [ "$extracted" = "$REV" ] && [ -e "${TOOLCHAIN_GO}" ]; then # already ok