1#!/bin/sh -u
2# tools/update-upstreams.sh -- files to their latest version
3# Copyright (C) 2017, 2019, 2021  Olaf Meeuwissen
4#
5# License: GPL-3.0+
6
7fetch () {
8    if type curl 2>/dev/null >/dev/null ; then
9        curl --location --remote-name $1
10        return
11    fi
12    if type wget 2>/dev/null >/dev/null ; then
13        wget --output-document $(echo $1 | sed 's,.*/,,') $1
14    fi
15}
16
17CONFIG_BASE_URL=https://git.savannah.gnu.org/cgit/config.git/plain
18
19for file in config.guess config.sub; do
20    fetch $CONFIG_BASE_URL/$file
21done
22
23GNULIB_BASE_URL=https://git.savannah.gnu.org/cgit/gnulib.git/plain
24fetch $GNULIB_BASE_URL/build-aux/git-version-gen
25mv git-version-gen tools/
26chmod 0755 tools/git-version-gen
27