AboutSummaryRefsLogTreeCommitDiffStats
path: root/maint.mk
diff options
context:
space:
mode:
authorMathieu Lirzin <mthl@gnu.org>2018-03-25 22:55:01 +0200
committerMathieu Lirzin <mthl@gnu.org>2018-03-26 01:46:44 +0200
commite66f0dcdd6f1838c8d4f5d70cea7ca63dc150ead (patch)
tree8bb6d5bd71d68749dc433bcf215f72e338afc5a9 /maint.mk
parent6c4f93371c7d0cd846c4b318e86f3761bf3e6e8c (diff)
downloadmcron-e66f0dcdd6f1838c8d4f5d70cea7ca63dc150ead.tar.gz
mcron-e66f0dcdd6f1838c8d4f5d70cea7ca63dc150ead.tar.bz2
mcron-e66f0dcdd6f1838c8d4f5d70cea7ca63dc150ead.zip
maint: Replace "build-aux/gnu-fetch" with 'fetch' maintainer rule
Fetching third-party files inside a make rule is convenient and less error prone since 'make' has access to '$srcdir'. * build-aux/gnu-fetch: Delete. * maint.mk (WGET, git_sv_host, sv_git_am, sv_git_gl) (fetchfiles): New macros. (fetch): New target. * HACKING <Updating auxilary scripts>: Update instructions.
Diffstat (limited to 'maint.mk')
-rw-r--r--maint.mk43
1 files changed, 43 insertions, 0 deletions
diff --git a/maint.mk b/maint.mk
index 791e366..115fde6 100644
--- a/maint.mk
+++ b/maint.mk
@@ -18,3 +18,46 @@
# Rebuild Makefile.in if this file is modifed.
Makefile.in: maint.mk
+
+## -------------------- ##
+## Third-party files. ##
+## ---------------------##
+
+WGET = wget
+
+# Git repositories on Savannah.
+git_sv_host = git.savannah.gnu.org
+
+# Some repositories we sync files from.
+sv_git_am = 'https://$(git_sv_host)/gitweb/?p=automake.git;a=blob_plain;hb=HEAD;f='
+sv_git_gl = 'https://$(git_sv_host)/gitweb/?p=gnulib.git;a=blob_plain;hb=HEAD;f='
+
+# Files that we fetch and which we compare against.
+# Note that the 'lib/COPYING' file must still be synced by hand.
+fetchfiles = \
+ $(sv_git_am)contrib/test-driver.scm \
+ $(sv_git_gl)build-aux/do-release-commit-and-tag \
+ $(sv_git_gl)build-aux/gitlog-to-changelog \
+ ${sv_git_gl}build-aux/gnu-web-doc-update \
+ $(sv_git_gl)build-aux/gnupload
+
+# Fetch the latest versions of few scripts and files we care about.
+# A retrieval failure or a copying failure usually mean serious problems,
+# so we'll just bail out if 'wget' or 'cp' fail.
+fetch:
+ $(AM_V_at)rm -rf Fetchdir
+ $(AM_V_at)mkdir Fetchdir
+ $(AM_V_GEN)set -e; \
+ if $(AM_V_P); then wget_opts=; else wget_opts=-nv; fi; \
+ for url in $(fetchfiles); do \
+ file=`printf '%s\n' "$$url" | sed 's|^.*/||; s|^.*=||'`; \
+ $(WGET) $$wget_opts "$$url" -O Fetchdir/$$file || exit 1; \
+ if cmp Fetchdir/$$file $(srcdir)/build-aux/$$file >/dev/null; then \
+ : Nothing to do; \
+ else \
+ echo "$@: updating file $$file"; \
+ cp Fetchdir/$$file $(srcdir)/build-aux/$$file || exit 1; \
+ fi; \
+ done
+ $(AM_V_at)rm -rf Fetchdir
+.PHONY: fetch