From 7cbef7b26f19531c62536c0e17892b84c2401f5a Mon Sep 17 00:00:00 2001 From: Tim Hockin Date: Thu, 7 May 2020 21:46:33 -0700 Subject: [PATCH] Fix truncated logfile in verify-vendor Writing to /dev/stderr causes a new FD to be opened. If this is a literal file, that file can get truncated. `>&2` does not suffer the same problem. --- hack/update-vendor-licenses.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hack/update-vendor-licenses.sh b/hack/update-vendor-licenses.sh index 71a329eb64e..45567512380 100755 --- a/hack/update-vendor-licenses.sh +++ b/hack/update-vendor-licenses.sh @@ -187,11 +187,11 @@ fi # Loop through every vendored package for PACKAGE in $(go list -m -json all | jq -r .Path | sort -f); do if [[ -e "staging/src/${PACKAGE}" ]]; then - echo "${PACKAGE} is a staging package, skipping" > /dev/stderr + echo "${PACKAGE} is a staging package, skipping" >&2 continue fi if [[ ! -e "${DEPS_DIR}/${PACKAGE}" ]]; then - echo "${PACKAGE} doesn't exist in ${DEPS_DIR}, skipping" > /dev/stderr + echo "${PACKAGE} doesn't exist in ${DEPS_DIR}, skipping" >&2 continue fi echo "${PACKAGE}" @@ -214,7 +214,7 @@ for PACKAGE in $(go list -m -json all | jq -r .Path | sort -f); do file="${CONTENT[${PACKAGE}-COPYING]-}" fi if [[ -z "${file}" ]]; then - cat > /dev/stderr << __EOF__ + cat >&2 << __EOF__ No license could be found for ${PACKAGE} - aborting. Options: