On 17/05/15 00:34, Jim Meyering wrote:
> I noticed that since the addition of the file,
> tests/tail-2/F-vs-rename.sh, one can no longer
> clone coreutils onto a case-challenged file system,
> because there is also a file in that directory whose
> name differs only in the case of the "f":
> 
>   tests/tail-2/f-vs-rename.sh
> 
> What do you think about fixing this?
> Since it's easy to avoid, you may want to write a
> syntax-check rule using something like this:
> 
>   $ git ls-files|tr '[:upper:]' '[:lower:]'|sort|uniq -d
>   tests/tail-2/f-vs-rename.sh
> 
> Actual consequence?
> When I clone onto an hfs file system (OS/X), the initial
> is shown as unclean, with tests/tail-2/F-vs-rename.sh
> being shown as modified (with the differences to transform
> it to the contents of the lower-case-named file).

Yes it's definitely worth avoiding that issue.
Proposed patch attached.

thanks!
Pádraig
>From 2e51be301f979b082855d11f50aa1beccd338a77 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?P=C3=A1draig=20Brady?= <[email protected]>
Date: Sun, 17 May 2015 10:51:15 +0100
Subject: [PATCH] build: avoid issues with case insensitive file systems

* cfg.mk (sc_case_insensitive_file_names): A new syntax-check rule.
* tests/tail-2/descriptor-vs-rename.sh: Rename from
tests/tail-2/f-vs-rename.sh
* tests/local.mk: Reference the renamed test.
Reported by Jim Meyering.
---
 cfg.mk                                                   | 6 ++++++
 tests/local.mk                                           | 2 +-
 tests/tail-2/{f-vs-rename.sh => descriptor-vs-rename.sh} | 0
 3 files changed, 7 insertions(+), 1 deletion(-)
 rename tests/tail-2/{f-vs-rename.sh => descriptor-vs-rename.sh} (100%)

diff --git a/cfg.mk b/cfg.mk
index 8526853..f163a40 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -308,6 +308,12 @@ check-programs-vs-x:
 	done;						\
 	exit $$status
 
+# Ensure we can check out on case insensitive file systems
+sc_case_insensitive_file_names:
+	@git ls-files | sort -f | uniq -Di | grep . && \
+	  { echo "$(ME): the above file(s) conflict on case insensitive" \
+	  " file systems" 1>&2; exit 1; } || :
+
 # Ensure that the end of each release's section is marked by two empty lines.
 sc_NEWS_two_empty_lines:
 	@sed -n 4,/Noteworthy/p $(srcdir)/NEWS				\
diff --git a/tests/local.mk b/tests/local.mk
index 8d01064..bb78796 100644
--- a/tests/local.mk
+++ b/tests/local.mk
@@ -172,7 +172,7 @@ all_tests =					\
   tests/tail-2/inotify-hash-abuse2.sh		\
   tests/tail-2/F-vs-missing.sh			\
   tests/tail-2/F-vs-rename.sh			\
-  tests/tail-2/f-vs-rename.sh			\
+  tests/tail-2/descriptor-vs-rename.sh		\
   tests/tail-2/inotify-rotate.sh		\
   tests/tail-2/inotify-rotate-resources.sh	\
   tests/chmod/no-x.sh				\
diff --git a/tests/tail-2/f-vs-rename.sh b/tests/tail-2/descriptor-vs-rename.sh
similarity index 100%
rename from tests/tail-2/f-vs-rename.sh
rename to tests/tail-2/descriptor-vs-rename.sh
-- 
2.4.0

Reply via email to