From a6da6967977daddbb68fbe170429f0b5385bde94 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Tue, 24 Dec 2013 08:37:32 -0800 Subject: [PATCH] Makefile.am: Always use C locale for "sort" and "comm". Otherwise, if the user changes locales between running the "dist-hook-git" and "distfiles" targets (e.g. in different invocations of "make"), then the "dist-hook-git" target might falsely report that the distribution is missing files. Reported-by: John Darrington Signed-off-by: Ben Pfaff --- AUTHORS | 1 + Makefile.am | 9 +++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/AUTHORS b/AUTHORS index 7539b1af3..4c6c3655e 100644 --- a/AUTHORS +++ b/AUTHORS @@ -183,6 +183,7 @@ Jeff Merrick jmerrick@vmware.com Jeongkeun Lee jklee@hp.com Jian Qiu swordqiu@gmail.com Joan Cirer joan@ev0.net +John Darrington john@darrington.wattle.id.au John Galgay john@galgay.net John Hurley john.hurley@netronome.com Kevin Mancuso kevin.mancuso@rackspace.com diff --git a/Makefile.am b/Makefile.am index 6acb0a6b4..857708f0c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -164,10 +164,10 @@ dist-hook-git: distfiles @if test -e $(srcdir)/.git && (git --version) >/dev/null 2>&1; then \ (cd datapath && $(MAKE) distfiles); \ (cat distfiles; sed 's|^|datapath/|' datapath/distfiles) | \ - sort -u > all-distfiles; \ + LC_ALL=C sort -u > all-distfiles; \ (cd $(srcdir) && git ls-files) | grep -v '\.gitignore$$' | \ - sort -u > all-gitfiles; \ - comm -1 -3 all-distfiles all-gitfiles > missing-distfiles; \ + LC_ALL=C sort -u > all-gitfiles; \ + LC_ALL=C comm -1 -3 all-distfiles all-gitfiles > missing-distfiles; \ if test -s missing-distfiles; then \ echo "The distribution is missing the following files:"; \ cat missing-distfiles; \ @@ -182,7 +182,8 @@ distfiles: Makefile list='$(DISTFILES)'; \ for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t" | sort -u > $@ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t" | \ + LC_ALL=C sort -u > $@ CLEANFILES += distfiles endif .PHONY: dist-hook-git -- 2.47.0