Browse Source

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 <[email protected]>
James Tucker 3 years ago
parent
commit
7b1a91dfd3
1 changed files with 3 additions and 1 deletions
  1. 3 1
      tool/go

+ 3 - 1
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