0
Fork 0
mirror of https://github.com/project-zot/zot.git synced 2024-12-16 21:56:37 -05:00

fix: update-licenses make target does not use LC_ALL=C locale on some machines (#2023)

Signed-off-by: Alexei Dodon <adodon@cisco.com>
This commit is contained in:
Alexei Dodon 2023-11-09 19:31:08 +02:00 committed by GitHub
parent 3ddfd655ea
commit 16def78d84
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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";\