From 30577a1486da235d7d5062284edc46a12d80e2c9 Mon Sep 17 00:00:00 2001 From: Dmitri Goutnik Date: Tue, 14 Apr 2020 12:52:02 +0000 Subject: [PATCH] Mk/Uses/go.mk: Fix gomod-vendor-diff when there are 3 or fewer items in the GH_TUPLE 'make gomod-vendor-diff' currently doesn't work properly when modules2tuple doesn't return the first empty line, when 3 or fewer items are in the GH_TUPLE list. PR: 245617 Submitted by: yuri --- Mk/Uses/go.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mk/Uses/go.mk b/Mk/Uses/go.mk index c45181bd6156..1a025b2216cf 100644 --- a/Mk/Uses/go.mk +++ b/Mk/Uses/go.mk @@ -191,7 +191,7 @@ gomod-vendor: gomod-vendor-deps patch gomod-vendor-diff: gomod-vendor-deps patch @cd ${WRKSRC}; ${SETENV} GOPATH=${WRKDIR}/.gopath GOFLAGS=-modcacherw ${GO_CMD} mod vendor; \ - [ -r vendor/modules.txt ] && ${_MODULES2TUPLE_CMD} vendor/modules.txt | ${GREP} -v "^GH_TUPLE=" | ${SED} 's| \\$$||' > ${WRKDIR}/GH_TUPLE-new.txt && \ + [ -r vendor/modules.txt ] && ${_MODULES2TUPLE_CMD} vendor/modules.txt | ${SED} 's|GH_TUPLE=| |; s| \\$$||' | ${GREP} -v ' \\' > ${WRKDIR}/GH_TUPLE-new.txt && \ echo ${GH_TUPLE} | ${TR} -s " " "\n" | ${SED} "s|^| |" > ${WRKDIR}/GH_TUPLE-old.txt && \ ${DIFF} ${WRKDIR}/GH_TUPLE-old.txt ${WRKDIR}/GH_TUPLE-new.txt || exit 0 .endif