maint: provide make target to update gnulib to latest

* Makefile.am (gnulib-sync, update-gnulib-to-latest): Add targets to
pull the latest commit of the gnulib submodule, and also to copy over
the files we keep in sync.
* doc/find-maint.texi (How to update Gnulib to latest): Add section.
This commit is contained in:
Bernhard Voelker 2018-07-19 23:38:42 +02:00
parent e8599a9e33
commit 42e134a484
2 changed files with 38 additions and 0 deletions

View File

@ -89,6 +89,27 @@ findutils-check-smells:
-print0 | \
xargs -0 python $(AUXDIR)/src-sniff.py
# Update gnulib to latest, merging some additional files we take from there
# as well. This only works if the working tree of both findutils and gnulib
# are clean (which is checked first).
# The following is a good start to find additional candidates for copying:
# git ls-files \
# | sed 's,^.*/,,g; /^gnulib$/d; /^t-t$/d; /\.c$/d' \
# | grep -Ff - <( cd gnulib && git ls-files )
.PHONY: gnulib-sync update-gnulib-to-latest
gnulib-sync update-gnulib-to-latest:
@( cd $(srcdir) \
&& { printf 'gnulib: ' && git -C gnulib describe --always --dirty \
&& printf 'findutils: ' && git describe --always --dirty \
|| echo dirty; \
} | grep 'dirty$$' \
&& { echo "error: tree is dirty" >&2; exit 1; } || : \
&& git submodule foreach git pull origin master \
&& cp -v gnulib/doc/COPYINGv3 COPYING \
&& cp -v gnulib/build-aux/bootstrap bootstrap \
&& git status --short -- gnulib COPYING bootstrap \
)
# Clean coverage files generated by running binaries built with gcc
# -fprofile-arcs -ftest-coverage. We touch subdirectories here
# because the relevant Makefile.am files (which we would otherwise

View File

@ -554,6 +554,23 @@ local diffs to be patched into gnulib beneath the
@file{gnulib-local}. Normally however, there is no need for this,
since gnulib updates are very prompt.
@section How to update Gnulib to latest
With a non-dirty working tree, the command @code{make update-gnulib-to-latest}
(or the shorter alias @code{make gnulib-sync} allows, well, to update the
gnulib submodule. In detail, that is:
@enumerate
@item Fetching the latest upstream gnulib reference.
@item Copying the files which should stay in sync like
@file{bootstrap} from gnulib into the findutils working tree.
@item And finally showing the @code{git status} for the gnulib submodule
and the above copied files.
@end enumerate
After that, the maintainer compares if all is correct, if the findutils build
and run correct, and finally commits with the new gnulib version, e.g. via
@code{git gui}.
The @code{gnulib-sync} target can be run any time - after a @code{configure}
run -, and only rejects to run if the working tree is dirty.
@node Documentation
@chapter Documentation