]> git.sesse.net Git - stockfish/commitdiff
No error if net available but wget/curl missing
authorJoost VandeVondele <Joost.VandeVondele@gmail.com>
Mon, 19 Dec 2022 16:54:36 +0000 (17:54 +0100)
committerJoost VandeVondele <Joost.VandeVondele@gmail.com>
Mon, 19 Dec 2022 17:17:50 +0000 (18:17 +0100)
do not error out on missing wget/curl if these tools are not needed later on,
i.e. if the net is available already.

closes https://github.com/official-stockfish/Stockfish/pull/4291
closes https://github.com/official-stockfish/Stockfish/pull/4253

No functional change

src/Makefile

index da81ceb4a0e0f5f3ac0b365679dee6818c4bd8b0..bcf0abdf5ee986ed6d7c17c5cf24193c3d9159b4 100644 (file)
@@ -853,7 +853,7 @@ net:
        $(eval nnuedownloadurl2 := https://github.com/official-stockfish/networks/raw/master/$(nnuenet))
        $(eval curl_or_wget := $(shell if hash curl 2>/dev/null; then echo "curl -skL"; elif hash wget 2>/dev/null; then echo "wget -qO-"; fi))
        @if [ "x$(curl_or_wget)" = "x" ]; then \
-           echo "Automatic download failed: neither curl nor wget is installed. Install one of these tools or download the net manually"; exit 1; \
+           echo "Neither curl nor wget is installed. Install one of these tools unless the net has been downloaded manually"; \
         fi
        $(eval shasum_command := $(shell if hash shasum 2>/dev/null; then echo "shasum -a 256 "; elif hash sha256sum 2>/dev/null; then echo "sha256sum "; fi))
        @if [ "x$(shasum_command)" = "x" ]; then \
@@ -864,7 +864,9 @@ net:
              echo "$(nnuenet) available."; \
           else \
              if [ "x$(curl_or_wget)" != "x" ]; then \
-                echo "Downloading $${nnuedownloadurl}"; $(curl_or_wget) $${nnuedownloadurl} > $(nnuenet);\
+                 echo "Downloading $${nnuedownloadurl}"; $(curl_or_wget) $${nnuedownloadurl} > $(nnuenet);\
+              else \
+                 echo "No net found and download not possible"; exit 1;\
              fi; \
           fi; \
           if [ "x$(shasum_command)" != "x" ]; then \