summaryrefslogtreecommitdiff
path: root/maint.mk
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2011-05-10 21:45:54 +0200
committerGuido Günther <agx@sigxcpu.org>2011-05-10 21:45:54 +0200
commit1546b8c2d80477aa28e78875be0199ebec2f9c16 (patch)
treef4adc55df8992ed0903999d368fb5745b291bd4c /maint.mk
parenta91c8f6f163289d7e57930c5dcf1fb7f495fd724 (diff)
New upstream version 0.9.1
Diffstat (limited to 'maint.mk')
-rw-r--r--maint.mk44
1 files changed, 38 insertions, 6 deletions
diff --git a/maint.mk b/maint.mk
index 524b69f47..47cb44ee2 100644
--- a/maint.mk
+++ b/maint.mk
@@ -823,8 +823,8 @@ require_exactly_one_NL_at_EOF_ = \
END { exit defined $$fail }
sc_prohibit_empty_lines_at_EOF:
@perl -le '$(require_exactly_one_NL_at_EOF_)' $$($(VC_LIST_EXCEPT)) \
- || { echo '$(ME): empty line(s) or no newline at EOF' \
- 1>&2; exit 1; } || :; \
+ || { echo '$(ME): empty line(s) or no newline at EOF' \
+ 1>&2; exit 1; } || :
# Make sure we don't use st_blocks. Use ST_NBLOCKS instead.
# This is a bit of a kludge, since it prevents use of the string
@@ -841,6 +841,31 @@ sc_prohibit_S_IS_definition:
halt='do not define S_IS* macros; include <sys/stat.h>' \
$(_sc_search_regexp)
+prohibit_doubled_word_RE_ ?= \
+ /\b(then?|[iao]n|i[fst]|but|f?or|at|and|[dt]o)\s+\1\b/gims
+prohibit_doubled_word_ = \
+ -e 'while ($(prohibit_doubled_word_RE_))' \
+ -e ' {' \
+ -e ' $$n = ($$` =~ tr/\n/\n/ + 1);' \
+ -e ' ($$v = $$&) =~ s/\n/\\n/g;' \
+ -e ' print "$$ARGV:$$n:$$v\n";' \
+ -e ' }'
+
+# Define this to a regular expression that matches
+# any filename:dd:match lines you want to ignore.
+# The default is to ignore no matches.
+ignore_doubled_word_match_RE_ ?= ^$$
+
+sc_prohibit_doubled_word:
+ @perl -n -0777 $(prohibit_doubled_word_) $$($(VC_LIST_EXCEPT)) \
+ | grep -vE '$(ignore_doubled_word_match_RE_)' \
+ | grep . && { echo '$(ME): doubled words' 1>&2; exit 1; } || :
+
+sc_prohibit_can_not:
+ @prohibit='\<can[ ]not\>' \
+ halt='use "cannot", not "can'' not"' \
+ $(_sc_search_regexp)
+
_ptm1 = use "test C1 && test C2", not "test C1 -''a C2"
_ptm2 = use "test C1 || test C2", not "test C1 -''o C2"
# Using test's -a and -o operators is not portable.
@@ -917,16 +942,23 @@ update-NEWS-hash: NEWS
# Ensure that we use only the standard $(VAR) notation,
# not @...@ in Makefile.am, now that we can rely on automake
# to emit a definition for each substituted variable.
-# We use perl rather than "grep -nE ..." to exempt a single
-# use of an @...@-delimited variable name in src/Makefile.am.
+# However, there is still one case in which @VAR@ use is not just
+# legitimate, but actually required: when augmenting an automake-defined
+# variable with a prefix. For example, gettext uses this:
+# MAKEINFO = env LANG= LC_MESSAGES= LC_ALL= LANGUAGE= @MAKEINFO@
+# otherwise, makeinfo would put German or French (current locale)
+# navigation hints in the otherwise-English documentation.
+#
# Allow the package to add exceptions via a hook in cfg.mk;
# for example, @PRAGMA_SYSTEM_HEADER@ can be permitted by
# setting this to ' && !/PRAGMA_SYSTEM_HEADER/'.
_makefile_at_at_check_exceptions ?=
sc_makefile_at_at_check:
- @perl -ne '/\@[A-Z_0-9]+\@/'$(_makefile_at_at_check_exceptions) \
+ @perl -ne '/\@[A-Z_0-9]+\@/' \
+ -e ' && !/([A-Z_0-9]+)\s+=.*\@\1\@$$/' \
+ -e ''$(_makefile_at_at_check_exceptions) \
-e 'and (print "$$ARGV:$$.: $$_"), $$m=1; END {exit !$$m}' \
- $$($(VC_LIST_EXCEPT) | grep -E '(^|/)Makefile\.am$$') \
+ $$($(VC_LIST_EXCEPT) | grep -E '(^|/)(Makefile\.am|[^/]+\.mk)$$') \
&& { echo '$(ME): use $$(...), not @...@' 1>&2; exit 1; } || :
news-check: NEWS