Makefile.am: Always use C locale for "sort" and "comm".
authorBen Pfaff <blp@nicira.com>
Tue, 24 Dec 2013 16:37:32 +0000 (08:37 -0800)
committerBen Pfaff <blp@nicira.com>
Mon, 30 Dec 2013 17:43:27 +0000 (09:43 -0800)
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 <john@darrington.wattle.id.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
AUTHORS
Makefile.am

diff --git a/AUTHORS b/AUTHORS
index 7539b1a..4c6c365 100644 (file)
--- 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
index 6acb0a6..857708f 100644 (file)
@@ -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