2008-04-03 Eric Blake <ebb9@byu.net>
+ Fix VPATH 'make syntax-check'.
+ * maint.mk (VC_LIST, VC_LIST_EXCEPT, sc_changelog)
+ (sc_prohibit_jm_in_m4, makefile-check): Support VPATH.
+ (author_mark_check): Avoid error message.
+ * build-aux/vc-list-files: Sync from upstream again.
+ * build-aux/texinfo.tex: Likewise.
+
Sync files from upstream, and pass 'make syntax-check'.
* config/announce-gen: Move...
* build-aux/announce-gen: ...here, and sync from gnulib.
\def\argremovecomment#1\comment#2\ArgTerm{\argremovec #1\c\ArgTerm}
\def\argremovec#1\c#2\ArgTerm{\argcheckspaces#1\^^M\ArgTerm}
-% Each occurence of `\^^M' or `<space>\^^M' is replaced by a single space.
+% Each occurrence of `\^^M' or `<space>\^^M' is replaced by a single space.
%
% \argremovec might leave us with trailing space, e.g.,
% @end itemize @c foo
% to get _exactly_ the rest of the line, we had to prevent such situation.
% We prepended an \empty token at the very beginning and we expand it now,
% just before passing the control to \argtorun.
-% (Similarily, we have to think about #3 of \argcheckspacesY above: it is
+% (Similarly, we have to think about #3 of \argcheckspacesY above: it is
% either the null string, or it ends with \^^M---thus there is no danger
% that a pair of braces would be stripped.
%
% used to check whether the current environment is the one expected.
%
% Non-false conditionals (@iftex, @ifset) don't fit into this, so they
-% are not treated as enviroments; they don't open a group. (The
+% are not treated as environments; they don't open a group. (The
% implementation of @end takes care not to call \endgroup in this
% special case.)
-% At runtime, environments start with this:
+% At run-time, environments start with this:
\def\startenvironment#1{\begingroup\def\thisenv{#1}}
% initialize
\let\thisenv\empty
\fi
}
-% Evironment mismatch, #1 expected:
+% Environment mismatch, #1 expected:
\def\badenverr{%
\errhelp = \EMsimple
\errmessage{This command can appear only \inenvironment\temp,
%
% A straightforward implementation would start like this:
% \def\entry#1#2{...
-% But this frozes the catcodes in the argument, and can cause problems to
+% But this freezes the catcodes in the argument, and can cause problems to
% @code, which sets - active. This problem was fixed by a kludge---
% ``-'' was active throughout whole index, but this isn't really right.
%
\def\Edefun{\endgraf\medbreak}
% \makedefun{deffn} creates \deffn, \deffnx and \Edeffn;
-% the only thing remainnig is to define \deffnheader.
+% the only thing remaining is to define \deffnheader.
%
\def\makedefun#1{%
\expandafter\let\csname E#1\endcsname = \Edefun
% In case a @footnote appears in a vbox, save the footnote text and create
% the real \insert just after the vbox finished. Otherwise, the insertion
% would be lost.
-% Similarily, if a @footnote appears inside an alignment, save the footnote
+% Similarly, if a @footnote appears inside an alignment, save the footnote
% text to a box and make the \insert when a row of the table is finished.
% And the same can be done for other insert classes. --kasal, 16nov03.
#!/bin/sh
# List version-controlled file names.
+# Print a version string.
+scriptversion=2008-04-03.14
+
# Copyright (C) 2006-2008 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# List the specified version-controlled files.
# With no argument, list them all. With a single DIRECTORY argument,
# list the version-controlled files in that directory.
-# This script must be run solely from the top of a $srcdir build directory.
# If there's an argument, it must be a single, "."-relative directory name.
# cvsu is part of the cvsutils package: http://www.red-bean.com/cvsutils/
+postprocess=
+case $1 in
+ --help) cat <<EOF
+Usage: $0 [-C SRCDIR] [DIR]
+
+Output a list of version-controlled files in DIR (default .), relative to
+SRCDIR (default .). SRCDIR must be the top directory of a checkout.
+
+Options:
+ --help print this help, then exit
+ --version print version number, then exit
+ -C SRCDIR change directory to SRCDIR before generating list
+
+Report bugs and patches to <bug-gnulib@gnu.org>.
+EOF
+ exit ;;
+
+ --version)
+ year=`echo "$scriptversion" | sed 's/[^0-9].*//'`
+ cat <<EOF
+vc-list-files $scriptversion
+Copyright (C) $year Free Software Foundation, Inc,
+License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
+This is free software: you are free to change and redistribute it.
+There is NO WARRANTY, to the extent permitted by law.
+EOF
+ exit ;;
+
+ -C)
+ postprocess="| sed 's|^|$2/|'"
+ cd "$2" || exit 1
+ shift; shift ;;
+esac
+
dir=
case $# in
0) ;;
1) dir=$1 ;;
*) echo "$0: too many arguments" 1>&2
- echo "Usage: $0 [DIR]" 1>&2; exit 1;;
+ echo "Usage: $0 [-C srcdir] [DIR]" 1>&2; exit 1;;
esac
test "x$dir" = x && dir=.
if test -d .git; then
- exec git ls-files "$dir"
+ eval exec git ls-files '"$dir"' $postprocess
elif test -d .hg; then
- exec hg locate "$dir/*"
+ eval exec hg locate '"$dir/*"' $postprocess
elif test -d CVS; then
if test -x build-aux/cvsu; then
- build-aux/cvsu --find --types=AFGM "$dir"
+ eval build-aux/cvsu --find --types=AFGM '"$dir"' $postprocess
+ elif (cvsu --help) >/dev/null 2>&1; then
+ eval cvsu --find --types=AFGM '"$dir"' $postprocess
else
- awk -F/ '{ \
+ eval awk -F/ \''{ \
if (!$1 && $3 !~ /^-/) { \
f=FILENAME; \
sub(/CVS\/Entries/, "", f); \
print f $2; \
- }}' \
- $(find ${*-*} -name Entries -print) /dev/null;
+ }}'\'' \
+ $(find ${*-*} -name Entries -print) /dev/null' $postprocess
fi
else
- echo "$0: Failed to determine type of version control used in "`pwd` 1>&2
+ echo "$0: Failed to determine type of version control used in `pwd`" 1>&2
exit 1
fi
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
VC = $(GIT)
VC-tag = git tag -s -m '$(VERSION)'
-VC_LIST = build-aux/vc-list-files
+VC_LIST = $(srcdir)/build-aux/vc-list-files -C $(srcdir)
VC_LIST_EXCEPT = \
- $(VC_LIST) | if test -f .x-$@; then grep -vEf .x-$@; else grep -v ChangeLog; fi
+ $(VC_LIST) | if test -f $(srcdir)/.x-$@; then \
+ grep -vEf $(srcdir)/.x-$@; \
+ else \
+ grep -v ChangeLog; \
+ fi
ifeq ($(origin prev_version_file), undefined)
prev_version_file = $(srcdir)/.prev-version
# Collect the names of rules starting with `sc_'.
syntax-check-rules := $(shell sed -n 's/^\(sc_[a-zA-Z0-9_-]*\):.*/\1/p' \
- $(srcdir)/$(ME))
+ $(srcdir)/$(ME))
.PHONY: $(syntax-check-rules)
local-checks-available = \
# Each nonempty line must start with a year number, or a TAB.
sc_changelog:
- @grep -n '^[^12 ]' $$(find . -maxdepth 2 -name ChangeLog) && \
+ @grep -n '^[^12 ]' $$(find $(srcdir) -maxdepth 2 -name ChangeLog) && \
{ echo '$(ME): found unexpected prefix in a ChangeLog' 1>&2; \
exit 1; } || :
# Make sure that none are inadvertently reintroduced.
sc_prohibit_jm_in_m4:
@grep -nE 'jm_[A-Z]' \
- $$($(VC_LIST) $(srcdir)/m4 |grep '\.m4$$') && \
+ $$($(VC_LIST) m4 |grep '\.m4$$') && \
{ echo '$(ME): do not use jm_ in m4 macro names' \
1>&2; exit 1; } || :
# not @...@ in Makefile.am, now that we can rely on automake
# to emit a definition for each substituted variable.
makefile-check:
- grep -nE '@[A-Z_0-9]+@' `find . -name Makefile.am` \
+ grep -nE '@[A-Z_0-9]+@' `find $(srcdir) -name Makefile.am` \
&& { echo '$(ME): use $$(...), not @...@' 1>&2; exit 1; } || :
news-date-check: NEWS
# the English word `and', the string must be marked with `N_ (...)' so that
# gettext recognizes it as a string requiring translation.
author_mark_check:
- @grep -n '^# *define AUTHORS "[^"]* and ' src/*.c |grep -v ' N_ (' && \
+ @shopt -s nullglob; \
+ grep -n '^# *define AUTHORS "[^"]* and ' src/*.c /dev/null \
+ | grep -v ' N_ (' && \
{ echo '$(ME): enclose the above strings in N_ (...)' 1>&2; \
exit 1; } || :