[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: make check fix
From: |
Paul Eggert |
Subject: |
Re: make check fix |
Date: |
14 Aug 2003 11:34:22 -0700 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 |
Simon Josefsson <address@hidden> writes:
> For some reason sort in LANG=sv_SE.UTF-8 sort 'w' equal to 'v', making
> 'wc' end up before 'vdir', and a check fails.
Thanks for pointing this out. But the patch isn't quite right, since
you can't portably set LC_COLLATE to C without also setting LC_CTYPE
consistently, as the resulting behavior is undefined. It's simpler
just to set LC_ALL. Also, there are some other places that have the
same problem. How about the following patch instead?
2003-08-14 Paul Eggert <address@hidden>
* Makefile.maint (LC_ALL): Set to C.
* man/Makefile.am (ASSORT): New var.
(check-x-vs-1, programs): Use it.
* src/Makefile.am (ASSORT, check-README, ../AUTHORS): Likewise.
* tests/Makefile.am (ASSORT, all_programs): Likewise.
Index: Makefile.maint
===================================================================
RCS file: /cvsroot/coreutils/coreutils/Makefile.maint,v
retrieving revision 1.153
diff -p -u -r1.153 Makefile.maint
--- Makefile.maint 13 Aug 2003 07:33:17 -0000 1.153
+++ Makefile.maint 14 Aug 2003 18:23:04 -0000
@@ -43,6 +43,10 @@ my_distdir = $(PACKAGE)-$(VERSION)
# Used for diffs and xdeltas.
release_archive_dir ?= ../release
+# Prevent programs like 'sort' from considering distinct strings to be equal.
+# Doing it here saves us from having to set LC_ALL elsewhere in this file.
+export LC_ALL = C
+
## --------------- ##
Index: man/Makefile.am
===================================================================
RCS file: /cvsroot/coreutils/coreutils/man/Makefile.am,v
retrieving revision 1.21
diff -p -u -r1.21 Makefile.am
--- man/Makefile.am 26 Jul 2003 08:59:09 -0000 1.21
+++ man/Makefile.am 14 Aug 2003 18:23:05 -0000
@@ -135,21 +135,26 @@ mapped_name = `echo $*|sed 's/install/gi
check-local: check-x-vs-1 check-programs-vs-x
+# Sort in traditional ASCII order, regardless of the current locale;
+# otherwise we may get into trouble with distinct strings that the
+# current locale considers to be equal.
+ASSORT = LC_ALL=C sort
+
# Ensure that for each .x file in this directory, there is a
# corresponding .1 file in the definition of $(dist_man_MANS) above.
.PHONY: check-x-vs-1
check-x-vs-1:
PATH=../src$(PATH_SEPARATOR)$$PATH; export PATH; \
t=ls-files.$$$$; \
- (cd $(srcdir) && ls -1 *.x) | sed 's/\.x$$//' | sort > $$t; \
- echo $(dist_man_MANS) | fmt -w1 | sed 's/\.1$$//' | sort -u \
+ (cd $(srcdir) && ls -1 *.x) | sed 's/\.x$$//' | $(ASSORT) > $$t;\
+ echo $(dist_man_MANS) | fmt -w1 | sed 's/\.1$$//' | $(ASSORT) \
| diff - $$t || { rm $$t; exit 1; }; \
rm $$t
programs = \
echo 'spy:;@echo $$(all_programs)' \
| MAKEFLAGS= $(MAKE) -s -C $(srcdir)/../src -f Makefile -f - spy \
- | fmt -1 | sort -u | grep -v '\['
+ | fmt -1 | $(ASSORT) -u | grep -v '\['
.PHONY: check-programs-vs-x
check-programs-vs-x:
Index: src/Makefile.am
===================================================================
RCS file: /cvsroot/coreutils/coreutils/src/Makefile.am,v
retrieving revision 1.31
diff -p -u -r1.31 Makefile.am
--- src/Makefile.am 26 Jul 2003 07:28:43 -0000 1.31
+++ src/Makefile.am 14 Aug 2003 18:23:05 -0000
@@ -211,6 +211,11 @@ all_programs = \
$(bin_SCRIPTS) \
$(EXTRA_PROGRAMS)
+# Sort in traditional ASCII order, regardless of the current locale;
+# otherwise we may get into trouble with distinct strings that the
+# current locale considers to be equal.
+ASSORT = LC_ALL=C sort
+
pm = progs-makefile
pr = progs-readme
# Ensure that the list of programs in README matches the list
@@ -220,7 +225,7 @@ check: check-README check-misc
check-README:
rm -rf $(pr) $(pm)
echo $(all_programs) \
- | tr -s ' ' '\n' | sort -u > $(pm)
+ | tr -s ' ' '\n' | $(ASSORT) -u > $(pm) && \
sed -n '/^The programs .* are:/,/^[a-zA-Z]/p' $(top_srcdir)/README \
| sed -n '/^ */s///p' | tr -s ' ' '\n' > $(pr)
diff $(pm) $(pr) && rm -rf $(pr) $(pm)
@@ -259,6 +264,6 @@ s2 = '/^\#define AUTHORS \\\\/{;n;$(sed_
prog=`echo $$i|sed 's/\.c$$//'`; \
echo "$$prog: $$a"; \
fi; \
- done | sort -u ) > address@hidden
+ done | $(ASSORT) -u ) > address@hidden
chmod a-w address@hidden
mv address@hidden $@
Index: tests/Makefile.am
===================================================================
RCS file: /cvsroot/coreutils/coreutils/tests/Makefile.am,v
retrieving revision 1.10
diff -p -u -r1.10 Makefile.am
--- tests/Makefile.am 1 Aug 2003 22:32:41 -0000 1.10
+++ tests/Makefile.am 14 Aug 2003 18:23:05 -0000
@@ -1,9 +1,14 @@
## Process this file with automake to produce Makefile.in -*-Makefile-*-.
+# Sort in traditional ASCII order, regardless of the current locale;
+# otherwise we may get into trouble with distinct strings that the
+# current locale considers to be equal.
+ASSORT = LC_ALL=C sort
+
all_programs = \
echo 'spy:;@echo $$(all_programs)' \
| MAKEFLAGS= $(MAKE) -s -C ../src -f Makefile -f - spy \
- | fmt -1 | sort -u
+ | fmt -1 | $(ASSORT) -u
TESTS = help-version
TESTS_ENVIRONMENT = \
- make check fix, Simon Josefsson, 2003/08/14
- Re: make check fix,
Paul Eggert <=