[David Bremner] Re: [PATCH] test-databases: use wget or curl to download test databases

2017-03-16 Thread David Bremner
--- Begin Message ---
Tomi Ollila  writes:

> 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.

pushed.

d
--- End Message ---
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH] test-databases: use wget or curl to download test databases

2017-03-14 Thread David Bremner
Tomi Ollila  writes:

> 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.

the patch is OK for me. What I wondered was if we should switch to
committing the test artifact(s) to a git branch (maybe even to
master). Originally I was worried about accumulating binary blobs in git
history, but it seems we rarely change this blob.  Of course using git
is problem for people who want to run the upgrade tests without a git
checkout; I'm not sure how many of those people there are.

The performance test corpus is large enough that I think the seperate
download makes sense. I also hope that it will be updated to reflect
more real world bottlenecks.

d
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


[PATCH] test-databases: use wget or curl to download test databases

2017-03-12 Thread Tomi Ollila
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.
---

This is an update to id:1395846591-3490-1-git-send-email-tomi.oll...@iki.fi
(~1080 days). Changed 'hash' to 'command -v' and added '-L' to curl options
(just to be sure) -- and added more detail to the commit message -- Latest
observation was that centos 7 (docker) container image did not have wget(1)
but curl(1) there were.

David asked whether this a job for configure. For the time being I think this
is simplest to use -- any alternative adds unnecessary cohesion between the
tool/configuration and this make. If, in the future, we will add more online
capabilities to this (test) system, then, perhaps we'd better to make some
script (as command) to handle that; now 3 years has passed since my previous
version -- and that is good as we'd like to be as offline as possible there.

 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 dcc8863c70d8..7aedff70f6e3 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}
 
-- 
2.11.0

___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch