From 8394dc6b446e745b430f880dd08fb664379cdbe0 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Fri, 27 Jul 2012 12:12:42 +0200 Subject: [PATCH] maint.mk: new rule: refresh-gnulib-patches I noticed that 8 of coreutils' 9 gl/**/*.diff files was stale. Use this rule to refresh them. * top/maint.mk (refresh-gnulib-patches): New rule. --- ChangeLog | 7 +++++++ top/maint.mk | 25 +++++++++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/ChangeLog b/ChangeLog index c41549fdf..22dedf407 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2012-07-27 Jim Meyering + + maint.mk: new rule: refresh-gnulib-patches + I noticed that 8 of coreutils' 9 gl/**/*.diff files was stale. + Use this rule to refresh them. + * top/maint.mk (refresh-gnulib-patches): New rule. + 2012-07-24 Bruno Haible gnulib-tool: Fix handling of inctests variable. diff --git a/top/maint.mk b/top/maint.mk index b39e9ae5a..baff0e989 100644 --- a/top/maint.mk +++ b/top/maint.mk @@ -1429,6 +1429,31 @@ gen-coverage: coverage: init-coverage build-coverage gen-coverage +# Some projects carry local adjustments for gnulib modules via patches in +# a gnulib patch directory whose default name is gl/ (defined in bootstrap +# via local_gl_dir=gl). Those patches become stale as the originals evolve +# in gnulib. Use this rule to refresh any stale patches. It applies each +# patch to the original in $(gnulib_dir) and uses the temporary result to +# generate a fuzz-free .diff file. If you customize the name of your local +# gnulib patch directory via bootstrap.conf, this rule detects that name. +# Run this from a non-VPATH (i.e., srcdir) build directory. +.PHONY: refresh-gnulib-patches +refresh-gnulib-patches: + gl=gl; \ + if test -f bootstrap.conf; then \ + t=$$(perl -lne '/^\s*local_gl_dir=(\S+)/ and $$d=$$1;' \ + -e 'END{defined $$d and print $$d}' bootstrap.conf); \ + test -n "$$t" && gl=$$t; \ + fi; \ + for diff in $$(cd $$gl; git ls-files | grep '\.diff$$'); do \ + b=$$(printf %s "$$diff"|sed 's/\.diff$$//'); \ + VERSION_CONTROL=none \ + patch "$(gnulib_dir)/$$b" "$$gl/$$diff" || exit 1; \ + ( cd $(gnulib_dir) || exit 1; \ + git diff "$$b" > "../$$gl/$$diff"; \ + git checkout $$b ) || exit 1; \ + done + # Update gettext files. PACKAGE ?= $(shell basename $(PWD)) PO_DOMAIN ?= $(PACKAGE) -- 2.11.0