On Sat, Jan 4, 2014 at 11:15 AM, Paul Eggert <[email protected]> wrote:
> Jim Meyering wrote:
>>
>> How about this?
>
>
> Thanks, but I can't tell from the patch how to exercise just the new check.

"make sc_maint" doesn't do precisely what you want, but is more
focused than "make check", and I ensured it passed with last night's
patch.

> I tried applying it and running 'make check', but the process
> took many minutes and failed due to another problem:

Yes, that's a separate problem, worthy of a few patches, it seems.

> Makefile:142: recipe for target 'sc_check_copyright' failed
> make: *** [sc_check_copyright] Error 1
>
> with a long list of file names and licenses and no obvious clue as
> to what the real problem is there.
>
> Getting back to your patch, I do have qualms about that
> regular expression: what if it's used in a UTF-8 locale
> where UTF-characters can be alphabetic?  The C locale is
> UTF-8 on some platforms, if memory serves.

Good point. Here's an improved version:
(though I generated the regex manually, so it may have a hole or two
-- will double-check)
From 0f3a66244773007c93c691701bb4f6018bd57122 Mon Sep 17 00:00:00 2001
From: Jim Meyering <[email protected]>
Date: Sat, 4 Jan 2014 10:50:45 -0800
Subject: [PATCH] maint: add a gnulib-local rule to keep non-ascii out of .texi
 files

* cfg.mk (sc_keep_gnulib_texi_files_mostly_ascii): New rule,
so that "make sc_maint" will ding anyone who puts non-ascii
in any of gnulib's .texi files.
---
 ChangeLog |  7 +++++++
 cfg.mk    | 12 ++++++++++++
 2 files changed, 19 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 278e656..4460528 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2014-01-04  Jim Meyering  <[email protected]>
+
+       maint: add a gnulib-local rule to keep non-ascii out of .texi files
+       * cfg.mk (sc_keep_gnulib_texi_files_mostly_ascii): New rule,
+       so that "make sc_maint" will ding anyone who puts non-ascii
+       in any of gnulib's .texi files.
+
 2014-01-03  Jim Meyering  <[email protected]>

        freadable, fwritable, fwriting: declare with the "pure" attribute
diff --git a/cfg.mk b/cfg.mk
index f1bdec1..5b9456b 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -1,5 +1,17 @@
 # This file is used via the maint.mk-using rule in Makefile.

+# This is a gnulib-specific rule to keep non-ascii characters
+# from creeping into our .texi files.  There is nothing inherently
+# wrong with e.g., UTF-8 characters in texinfo sources, but here,
+# we had accumulated some non-ascii apostrophes and hyphens, and
+# they were recently replaced with their ascii analogs.  This rule
+# should help keep things consistent.
+sc_keep_gnulib_texi_files_mostly_ascii:
+       @prohibit='[^][  a-zA-Z0-9'\''`~!\@#$$%^&*(){}=+";:,./<>?|\_-]' \
+       in_vc_files='\.texi$$'                                          \
+       halt='invalid bytes in gnulib .texi file'                       \
+         $(_sc_search_regexp)
+
 local-checks-to-skip =                 \
   sc_GFDL_version                      \
   sc_GPL_version                       \
-- 
1.8.5.2.229.g4448466

Reply via email to