# HG changeset patch # User Jim Meyering # Date 1343383962 -7200 # Node ID f471a51b1369ada9e6b764001ee54aa33f636a90 # Parent 1a403c75d360b41557e1354c31b9d70e17db9261 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. diff -r 1a403c75d360 -r f471a51b1369 ChangeLog --- a/ChangeLog Tue Jul 24 23:35:41 2012 +0200 +++ b/ChangeLog Fri Jul 27 12:12:42 2012 +0200 @@ -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 -r 1a403c75d360 -r f471a51b1369 top/maint.mk --- a/top/maint.mk Tue Jul 24 23:35:41 2012 +0200 +++ b/top/maint.mk Fri Jul 27 12:12:42 2012 +0200 @@ -1429,6 +1429,31 @@ 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)