SummaryRefsLogTreeCommitDiffStats
diff options
context:
space:
mode:
authorMathieu Lirzin <mthl@gnu.org>2018-03-24 22:06:44 +0100
committerMathieu Lirzin <mthl@gnu.org>2018-03-24 22:06:44 +0100
commita8511ce35d33e408de5dd16bc1e1ff9bb2e606cf (patch)
tree9f72896841f940d3f8bd863bc9608051525dcecc
parent0159423d15f882d9e44edd1a51dc13314c25e15b (diff)
downloadmcron-a8511ce35d33e408de5dd16bc1e1ff9bb2e606cf.tar.gz
mcron-a8511ce35d33e408de5dd16bc1e1ff9bb2e606cf.tar.bz2
mcron-a8511ce35d33e408de5dd16bc1e1ff9bb2e606cf.zip
maint: Add "build-aux/gnu-fetch" script.
* build-aux/gnu-fetch: New script for fetching auxilary scripts maintained in other GNU repositories. * HACKING: Document how to run it.
-rw-r--r--HACKING8
-rwxr-xr-xbuild-aux/gnu-fetch97
2 files changed, 104 insertions, 1 deletions
diff --git a/HACKING b/HACKING
index a9e9f5a..039e9d1 100644
--- a/HACKING
+++ b/HACKING
@@ -52,10 +52,16 @@ follows.
Run the command "git format-patch --stdout -1", and email its output in,
using the output's subject line.
+* Updating auxilary scripts
+
+ Fetch new versions of the files that are maintained in other GNU
+ repositories by running "cd build-aux; ./gnu-fetch". In case any file in the
+ Mcron repository has been updated, commit and re-run the testsuite.
+
-----
Copyright © 2002-2017 Free Software Foundation, Inc.
-Copyright © 2017 Mathieu Lirzin <mthl@gnu.org>
+Copyright © 2017, 2018 Mathieu Lirzin <mthl@gnu.org>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/build-aux/gnu-fetch b/build-aux/gnu-fetch
new file mode 100755
index 0000000..5655b16
--- /dev/null
+++ b/build-aux/gnu-fetch
@@ -0,0 +1,97 @@
+#!/bin/sh
+# Fetch files maintained in other GNU repositories.
+
+scriptversion=2018-03-24.21; # UTC
+
+# Copyright © 2018 Mathieu Lirzin <mthl@gnu.org>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+set -e
+
+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/gitlog-to-changelog
+ ${sv_git_gl}build-aux/do-release-commit-and-tag
+ ${sv_git_gl}build-aux/gnu-web-doc-update
+ ${sv_git_gl}build-aux/gnupload
+"
+
+usage="Usage: $0
+
+fetch files maintained in other GNU repositories
+"
+
+while test -n "$1"
+do
+ case $1 in
+ -*)
+ case $1 in
+ --help)
+ echo "$usage"
+ exit $?
+ ;;
+ --version)
+ echo "gnu-fetch $scriptversion"
+ exit $?
+ ;;
+ --)
+ shift
+ break
+ ;;
+ -*)
+ echo "$0: Unknown option '$1', try '$0 --help'" 1>&2
+ exit 1
+ ;;
+ esac
+ ;;
+ esac
+ shift
+done
+
+rm -rf Fetchdir
+mkdir Fetchdir
+for url in ${FETCHFILES}
+do
+ file=`printf '%s\n' "$url" | sed 's|^.*/||; s|^.*=||'`
+ "$WGET" -nv "$url" -O "Fetchdir/$file" || exit 1
+ if cmp "Fetchdir/$file" "$file" >/dev/null; then
+ : Nothing to do
+ else
+ echo "$0: updating file $file"
+ cp "Fetchdir/$file" "$file" || exit 1
+ fi
+done
+rm -rf Fetchdir
+
+exit 0
+
+# Local variables:
+# eval: (add-hook 'before-save-hook 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC0"
+# time-stamp-end: "; # UTC"
+# End: