mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2026-11-17 18:02:09 +03:00
build: factor out a little more re list of *.texi files
We may well want to switch from checking all *.texi to checking only version-controlled .texi files, so encapsulate this concept in one place. * doc/local.mk (doc_srcdir): Delete. Use this instead: (texi_files): Define. All usages adjusted.
This commit is contained in:
1 parent
408abf8586
commit
a13ffec338
1 file changed
+15
-15
+15
-15
@@ -24,8 +24,6 @@ doc_coreutils_TEXINFOS = \
|
||||
doc/constants.texi \
|
||||
doc/fdl.texi
|
||||
|
||||
doc_srcdir = $(top_srcdir)/doc
|
||||
|
||||
# The following is necessary if the package name is 8 characters or longer.
|
||||
# If the info documentation would be split into 10 or more separate files,
|
||||
# then this is necessary even if the package name is 7 characters long.
|
||||
@@ -62,26 +60,28 @@ syntax_checks = \
|
||||
sc-lower-case-var \
|
||||
sc-use-small-caps-NUL
|
||||
|
||||
texi_files = $(srcdir)/doc/*.texi
|
||||
|
||||
.PHONY: $(syntax_checks) check-texinfo
|
||||
|
||||
# List words/regexps here that should not appear in the texinfo documentation.
|
||||
check-texinfo: $(syntax_checks)
|
||||
$(AM_V_GEN)fail=0; \
|
||||
grep '@url{' $(doc_srcdir)/*.texi && fail=1; \
|
||||
grep '\$$@"' $(doc_srcdir)/*.texi && fail=1; \
|
||||
grep -n '[^[:punct:]]@footnote' $(doc_srcdir)/*.texi && fail=1; \
|
||||
grep -n filename $(doc_srcdir)/*.texi \
|
||||
grep '@url{' $(texi_files) && fail=1; \
|
||||
grep '\$$@"' $(texi_files) && fail=1; \
|
||||
grep -n '[^[:punct:]]@footnote' $(texi_files) && fail=1; \
|
||||
grep -n filename $(texi_files) \
|
||||
| $(EGREP) -v 'setfilename|[{]filename[}]' \
|
||||
&& fail=1; \
|
||||
exit $$fail
|
||||
|
||||
sc-avoid-builtin:
|
||||
$(AM_V_GEN)$(EGREP) -i '$(_W)builtins?$(W_)' $(doc_srcdir)/*.texi \
|
||||
$(AM_V_GEN)$(EGREP) -i '$(_W)builtins?$(W_)' $(texi_files) \
|
||||
&& exit 1 || :
|
||||
|
||||
sc-avoid-path:
|
||||
$(AM_V_GEN)fail=0; \
|
||||
$(EGREP) -i '$(_W)path(name)?s?$(W_)' $(doc_srcdir)/*.texi \
|
||||
$(EGREP) -i '$(_W)path(name)?s?$(W_)' $(texi_files) \
|
||||
| $(EGREP) -v \
|
||||
'PATH=|path search|search path|@vindex PATH$$|@env[{]PATH[}]' \
|
||||
&& fail=1; \
|
||||
@@ -89,28 +89,28 @@ sc-avoid-path:
|
||||
|
||||
# Use "time zone", not "timezone".
|
||||
sc-avoid-timezone:
|
||||
$(AM_V_GEN)$(EGREP) timezone $(doc_srcdir)/*.texi && exit 1 || :
|
||||
$(AM_V_GEN)$(EGREP) timezone $(texi_files) && exit 1 || :
|
||||
|
||||
# Check for insufficient exponent grouping, e.g.,
|
||||
# @math{2^64} should be @math{2^{64}}.
|
||||
sc-exponent-grouping:
|
||||
$(AM_V_GEN)$(EGREP) '\{.*\^[0-9][0-9]' $(doc_srcdir)/*.texi && exit 1 || :
|
||||
$(AM_V_GEN)$(EGREP) '\{.*\^[0-9][0-9]' $(texi_files) && exit 1 || :
|
||||
|
||||
# E.g., use @sc{nul}, not NUL.
|
||||
sc-use-small-caps-NUL:
|
||||
$(AM_V_GEN)$(EGREP) '$(_W)NUL$(W_)' $(doc_srcdir)/*.texi && exit 1 || :
|
||||
$(AM_V_GEN)$(EGREP) '$(_W)NUL$(W_)' $(texi_files) && exit 1 || :
|
||||
|
||||
# Say I/O, not IO.
|
||||
sc-avoid-io:
|
||||
$(AM_V_GEN)$(EGREP) '$(_W)IO$(W_)' $(doc_srcdir)/*.texi && exit 1 || :
|
||||
$(AM_V_GEN)$(EGREP) '$(_W)IO$(W_)' $(texi_files) && exit 1 || :
|
||||
|
||||
# I prefer nonzero over non-zero.
|
||||
sc-avoid-non-zero:
|
||||
$(AM_V_GEN)$(EGREP) non-zero $(doc_srcdir)/*.texi && exit 1 || :
|
||||
$(AM_V_GEN)$(EGREP) non-zero $(texi_files) && exit 1 || :
|
||||
|
||||
# Use "zeros", not "zeroes" (nothing wrong with "zeroes"; just be consistent).
|
||||
sc-avoid-zeroes:
|
||||
$(AM_V_GEN)$(EGREP) -i '$(_W)zeroes$(W_)' $(doc_srcdir)/*.texi \
|
||||
$(AM_V_GEN)$(EGREP) -i '$(_W)zeroes$(W_)' $(texi_files) \
|
||||
&& exit 1 || :
|
||||
|
||||
# The quantity inside @var{...} should not contain upper case letters.
|
||||
@@ -126,6 +126,6 @@ find_upper_case_var = \
|
||||
END {$$m and (warn "$@: do not use upper case in \@var{...}\n"), exit 1}'
|
||||
sc-lower-case-var:
|
||||
$(AM_V_GEN)$(PERL) -e 1 || { echo $@: skipping test; exit 0; }; \
|
||||
$(PERL) -lne $(find_upper_case_var) $(doc_srcdir)/*.texi
|
||||
$(PERL) -lne $(find_upper_case_var) $(texi_files)
|
||||
|
||||
check-local: check-texinfo
|
||||
Reference in new issue
Block a user