diff options
| author | Tomi Ollila <tomi.ollila@iki.fi> | 2017-03-12 14:59:33 +0200 |
|---|---|---|
| committer | David Bremner <david@tethera.net> | 2017-03-15 22:06:12 -0300 |
| commit | 9c3a27dee949f76ad4780c716142c22cd9ba4911 (patch) | |
| tree | 5f26a875e7d5c32e7e691135cc0a4f12ef8e5bad | |
| parent | 62822a4e2dee695c486383f0fe3d90edafae24db (diff) | |
test-databases: use wget or curl to download test databases
Often Linux systems are shipped with wget(1) by default (and no curl).
Many BSDs, macOS, and e.g. some Linux minimal/container images
comes with curl(1) (and no wget).
Attempting to download with curl if wget is not available increases
the likelihood for this to succeed.
| -rw-r--r-- | test/test-databases/Makefile.local | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/test/test-databases/Makefile.local b/test/test-databases/Makefile.local index dcc8863c..7aedff70 100644 --- a/test/test-databases/Makefile.local +++ b/test/test-databases/Makefile.local @@ -7,7 +7,13 @@ dir := test/test-databases test_databases := $(dir)/database-v1.tar.xz %.tar.xz: - wget -nv -O $@ ${TEST_DATABASE_MIRROR}/$(notdir $@); + @exec 1>&2 ;\ + if command -v wget >/dev/null ;\ + then set -x; wget -nv -O $@ ${TEST_DATABASE_MIRROR}/$(notdir $@) ;\ + elif command -v curl >/dev/null ;\ + then set -x; curl -L -s -o $@ ${TEST_DATABASE_MIRROR}/$(notdir $@) ;\ + else echo Cannot fetch databases, no wget nor curl available; exit 1 ;\ + fi download-test-databases: ${test_databases} |
