From 16def78d84a3e4eabf285dff8093c433f9464594 Mon Sep 17 00:00:00 2001 From: Alexei Dodon Date: Thu, 9 Nov 2023 19:31:08 +0200 Subject: [PATCH] fix: update-licenses make target does not use LC_ALL=C locale on some machines (#2023) Signed-off-by: Alexei Dodon --- Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 01fc1be7..7d8a8d31 100644 --- a/Makefile +++ b/Makefile @@ -326,11 +326,10 @@ swagger: .PHONY: update-licenses # note: for predictable output of below sort command we use locale LC_ALL=C -update-licenses: LC_ALL=C update-licenses: check-linux @echo "Detecting and updating licenses ... please be patient!" go install github.com/google/go-licenses@latest - $(shell echo "Module | License URL | License" > THIRD-PARTY-LICENSES.md; echo "---|---|---" >> THIRD-PARTY-LICENSES.md; for i in $$(go list -m all | awk '{print $$1}'); do l=$$(go-licenses csv $$i 2>/dev/null); if [ $$? -ne 0 ]; then continue; fi; echo $$l | tr \, \| | tr ' ' '\n'; done | sort -u >> THIRD-PARTY-LICENSES.md) + $(shell echo "Module | License URL | License" > THIRD-PARTY-LICENSES.md; echo "---|---|---" >> THIRD-PARTY-LICENSES.md; for i in $$(go list -m all | awk '{print $$1}'); do l=$$(go-licenses csv $$i 2>/dev/null); if [ $$? -ne 0 ]; then continue; fi; echo $$l | tr \, \| | tr ' ' '\n'; done | LC_ALL=C sort -u >> THIRD-PARTY-LICENSES.md) $(eval UNCOMMITED_FILES = $(shell git status --porcelain | grep -c THIRD-PARTY-LICENSES.md)) @if [ $(UNCOMMITED_FILES) != 0 ]; then \ echo "THIRD-PARTY-LICENSES.md file needs to be updated";\