Hi!
I was trying to reproduce some error in gnulib's syntax-check, and faced a few
issues.
My builddirs are in a separate tree, with symlinks from the src tree to them.
So running git from builddir will never work.
There are other errors, that I was not addressed.
error_quotes
env.c:337: " error at: %s"), str);
ls.c:2780: _("error canonicalizing %s"), name);
ls.c:3199: _("error canonicalizing %s"), full_name);
maint.mk: Use quote() for error string arguments
Cheers!
From dd4e813ab7ee3a8d9d27ca8f5eb874f991fff9b8 Mon Sep 17 00:00:00 2001
From: Akim Demaille
Date: Sat, 20 Jul 2019 09:04:00 +0200
Subject: [PATCH] maint: fix issues in syntax-check
* cfg.mk (sc_prohibit_colon_redirection): Don't expect `|` to denote
the pipe character in git grep.
(sc_tests_executable)
(sc_case_insensitive_file_names)
(sc_some_programs_must_avoid_exit_failure)
(sc_prohibit_test_background_without_cleanup_)
(sc_prohibit_test_calls_print_ver_with_irrelevant_argument)
(sc_prohibit_test_ulimit_without_require_)
(sc_prohibit_test_background_without_cleanup_)
(sc_THANKS_in_duplicates)
*sc_prohibit_test_calls_print_ver_with_irrelevant_argument):
Don't expect builddir to be a descendant of srcdir.
(sc_strftime_check): Don't check file size against 0 when "N\nq\n" was
already put in the file.
* THANKS.in: Remove me.
---
THANKS.in | 1 -
cfg.mk| 39 ++-
2 files changed, 22 insertions(+), 18 deletions(-)
diff --git a/THANKS.in b/THANKS.in
index 02b8ada1c..23b089754 100644
--- a/THANKS.in
+++ b/THANKS.in
@@ -25,7 +25,6 @@ Adam Klein akl...@debian.org
Adam Sampsona...@offog.org
Adrian Bunk b...@stusta.de
AIDA Shinra shi...@j10n.org
-Akim Demaille demai...@inf.enst.fr
Alain Magloire al...@qnx.com
Alan Iwii...@atm.ox.ac.uk
Alan Jenkinsalan-jenk...@tuffmail.co.uk
diff --git a/cfg.mk b/cfg.mk
index b0b758dd5..b589b40e3 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -121,6 +121,7 @@ sc_tests_list_consistency:
# Ensure that all version-controlled test scripts are executable.
sc_tests_executable:
@set -o noglob 2>/dev/null || set -f; \
+ cd $(srcdir); \
find_ext="-name '' "`printf -- "-o -name *%s " $(TEST_EXTENSIONS)`;\
find $(srcdir)/tests/ \( $$find_ext \) \! -perm -u+x -print\
| { sed "s|^$(srcdir)/||"; git ls-files $(srcdir)/tests/; } \
@@ -138,8 +139,8 @@ sc_ensure_gl_diffs_apply_cleanly:
# Avoid :>file which doesn't propagate errors
sc_prohibit_colon_redirection:
- @cd $(srcdir)/tests && GIT_PAGER= git grep -n ': *>.*||' \
- && { echo '$(ME): '"The leading colon in :> will hide errors" 1>&2; \
+ @cd $(srcdir)/tests && GIT_PAGER= git grep -En ': *>.*\|\|' \
+ && { echo '$(ME): '"The leading colon in :> will hide errors" >&2; \
exit 1; } \
|| :
@@ -407,7 +408,7 @@ check-programs-vs-x:
# Ensure we can check out on case insensitive file systems
sc_case_insensitive_file_names: src/uniq
- @git ls-files | sort -f | src/uniq -Di | grep . && \
+ @git -C $(srcdir) ls-files | sort -f | src/uniq -Di | grep . && \
{ echo "$(ME): the above file(s) conflict on case insensitive" \
" file systems" 1>&2; exit 1; } || :
@@ -445,20 +446,22 @@ sc_prohibit_stat_macro_address:
# Ensure that date's --help output stays in sync with the info
# documentation for GNU strftime. The only exception is %N and %q,
# which date accepts but GNU strftime does not.
+#
+# "info foo" fails with error, but not "info foo >/dev/null".
extract_char = sed 's/^[^%][^%]*%\(.\).*/\1/'
sc_strftime_check:
@if test -f $(srcdir)/src/date.c; then \
- grep '^ %. ' $(srcdir)/src/date.c | sort\
- | $(extract_char) > $@-src; \
- { echo N; echo q; \
- info libc date calendar format 2>/dev/null \
- | grep "^ *['\`]%.'$$"| $(extract_char); }| sort >$@-info;\
- if test $$(stat --format %s $@-info) != 2; then \
+ if info libc date calendar format 2>/dev/null | \
+ grep "^ *['\`]%.'$$" >$@-tmp; then \
+ { echo N; echo q; $(extract_char) $@-tmp; }| sort \
+ >$@-info; \
+ grep '^ %. ' $(srcdir)/src/date.c | sort \
+ | $(extract_char) > $@-src; \
diff -u $@-src $@-info || exit 1; \