bug#36739: [PATCH] maint: fix issues in syntax-check

2019-08-06 Thread Paul Eggert

Thanks, I installed that.





bug#36739: [PATCH] maint: fix issues in syntax-check

2019-08-06 Thread Bernhard Voelker
On 7/20/19 9:27 AM, Akim Demaille wrote:
>  # Ensure that tests call the print_ver_ function for programs which are
>  # actually used in that test.
>  sc_prohibit_test_calls_print_ver_with_irrelevant_argument:
> - @git grep -w print_ver_ $(srcdir)/tests \
> + @cd $(srcdir)   \
> + && git -C  grep -w print_ver_ tests \
> | sed 's#:print_ver_##'   \
> | { fail=0;   \
> while read file name; do  \

'git -C' is lacking the SRCDIR argument.
The attached fixes it.

Have a nice day,
Berny
>From 4f4475f2ffad417e021d08fbf4a742bda48b10ee Mon Sep 17 00:00:00 2001
From: Bernhard Voelker 
Date: Tue, 6 Aug 2019 22:23:36 +0200
Subject: [PATCH] maint: fix error in syntax-check checking

The previous commit introduced a bug into the following syntax-check,
and thus effectively turned it off:

  $ make sc_prohibit_test_calls_print_ver_with_irrelevant_argument; \
  echo $?
  prohibit_test_calls_print_ver_with_irrelevant_argument
  fatal: cannot change to 'grep': No such file or directory
  0

* cfg.mk (sc_prohibit_test_calls_print_ver_with_irrelevant_argument):
Remove changing directory, and pass $(srcdir) as argument to 'git -C'.
---
 cfg.mk | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/cfg.mk b/cfg.mk
index b589b40e3..2bc933c8b 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -635,8 +635,7 @@ sc_prohibit_test_background_without_cleanup_:
 # Ensure that tests call the print_ver_ function for programs which are
 # actually used in that test.
 sc_prohibit_test_calls_print_ver_with_irrelevant_argument:
-	@cd $(srcdir)			\
-	&& git -C  grep -w print_ver_ tests\
+	@git -C $(srcdir) grep -w print_ver_ tests			\
 	  | sed 's#:print_ver_##'	\
 	  | { fail=0;			\
 	  while read file name; do	\
-- 
2.22.0



bug#36739: [PATCH] maint: fix issues in syntax-check

2019-07-20 Thread Akim Demaille
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;   \