bug-findutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 1/2] maint: provide make target to update gnulib to latest


From: Bernhard Voelker
Subject: [PATCH 1/2] maint: provide make target to update gnulib to latest
Date: Fri, 2 Nov 2018 23:11:17 +0100

* 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.
---
 Makefile.am         | 21 +++++++++++++++++++++
 doc/find-maint.texi | 17 +++++++++++++++++
 2 files changed, 38 insertions(+)

diff --git a/Makefile.am b/Makefile.am
index ca36b7e2..b39c3fbf 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -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
diff --git a/doc/find-maint.texi b/doc/find-maint.texi
index b4badb53..168c806c 100644
--- a/doc/find-maint.texi
+++ b/doc/find-maint.texi
@@ -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.
 
address@hidden 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:
address@hidden
address@hidden Fetching the latest upstream gnulib reference.
address@hidden Copying the files which should stay in sync like
address@hidden from gnulib into the findutils working tree.
address@hidden And finally showing the @code{git status} for the gnulib 
submodule
+and the above copied files.
address@hidden 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
address@hidden 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
-- 
2.19.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]