* [PATCH 1/1] test-databases: use wget or curl to download test databases
@ 2014-03-26 15:09 Tomi Ollila
2014-03-26 16:38 ` David Bremner
0 siblings, 1 reply; 2+ messages in thread
From: Tomi Ollila @ 2014-03-26 15:09 UTC (permalink / raw)
To: notmuch; +Cc: tomi.ollila
On non-Linux systems curl(1) is often the tool of choice.
---
test/test-databases/Makefile.local | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/test/test-databases/Makefile.local b/test/test-databases/Makefile.local
index 0572e78..49db87b 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 ;: consistently write everything to stderr... ;\
+ if hash wget 2>/dev/null ;\
+ then set -x; wget -nv -O $@ ${TEST_DATABASE_MIRROR}/$(notdir $@) ;\
+ elif hash curl 2>/dev/null ;\
+ then set -x; curl -s -o $@ ${TEST_DATABASE_MIRROR}/$(notdir $@) ;\
+ else echo Cannot fetch databases, no wget nor curl available; exit 1 ;\
+ fi
download-test-databases: ${test_databases}
--
1.8.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 1/1] test-databases: use wget or curl to download test databases
2014-03-26 15:09 [PATCH 1/1] test-databases: use wget or curl to download test databases Tomi Ollila
@ 2014-03-26 16:38 ` David Bremner
0 siblings, 0 replies; 2+ messages in thread
From: David Bremner @ 2014-03-26 16:38 UTC (permalink / raw)
To: Tomi Ollila, notmuch; +Cc: tomi.ollila
Tomi Ollila <tomi.ollila@iki.fi> writes:
> %.tar.xz:
> - wget -nv -O $@ ${TEST_DATABASE_MIRROR}/$(notdir $@);
> + @exec 1>&2 ;: consistently write everything to stderr... ;\
> + if hash wget 2>/dev/null ;\
> + then set -x; wget -nv -O $@ ${TEST_DATABASE_MIRROR}/$(notdir $@) ;\
> + elif hash curl 2>/dev/null ;\
> + then set -x; curl -s -o $@ ${TEST_DATABASE_MIRROR}/$(notdir $@) ;\
> + else echo Cannot fetch databases, no wget nor curl available; exit 1 ;\
> + fi
Is this maybe a job for configure?
d
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-03-26 16:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-26 15:09 [PATCH 1/1] test-databases: use wget or curl to download test databases Tomi Ollila
2014-03-26 16:38 ` David Bremner
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).