On 06/25/2018 06:48 PM, Pádraig Brady wrote:
> `make gnulib-sync` would definitely be worth doing.

Done in the attached.  WDYT?

Have a nice day,
Berny
>From 586faca2682a9825b8d9f1ba43c29513a6d88487 Mon Sep 17 00:00:00 2001
From: Bernhard Voelker <[email protected]>
Date: Thu, 19 Jul 2018 08:20:49 +0200
Subject: [PATCH] maint: provide make target to update gnulib to latest

* Makefile.am (gnulib-sync, update-gnulib-to-latest): Add target to
pull the latest commit of the gnulib submodule, and also to copy over
the files we keep in sync; add them to the index as well.
---
 Makefile.am | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/Makefile.am b/Makefile.am
index ecebbdae7..691c0d447 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -182,6 +182,28 @@ check-git-hook-script-sync:
 	rm -rf $$t;							\
 	test $$fail = 0
 
+# Update gnulib to latest, merging some additional files we take from there
+# as well.  This only works if the working tree of both coreutils 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 'coreutils: ' &&  git describe --always --dirty \
+		  || echo dirty; \
+		  } | grep 'dirty$$' \
+			&& { echo "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 \
+	    && cp -v gnulib/tests/init.sh tests/init.sh \
+	    && git status --short -- gnulib COPYING bootstrap tests/init.sh \
+	)
+
 # If we are building a single-binary, create symlinks or shebangs for
 # the selected tools when installing.
 install-exec-hook:
-- 
2.18.0

Reply via email to