From 134e58ec8dd8fe030a1374067cea1226ab1d880f Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Wed, 9 Jan 2019 17:59:03 -0500 Subject: [PATCH] FileRules: Make DownloadLocatedFile1 less cryptic. As Jam prints the entire erring command on failure, including this if-test in the command itself makes the output somewhat difficult to decipher. So instead we use two separate rules based on whether or not NO_DOWNLOADS is set or not. --- build/jam/FileRules | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/build/jam/FileRules b/build/jam/FileRules index a84830fbe1..0329f69e4c 100644 --- a/build/jam/FileRules +++ b/build/jam/FileRules @@ -442,15 +442,20 @@ rule DownloadLocatedFile target : url : source DownloadLocatedFile1 $(target) : $(source) ; } -actions DownloadLocatedFile1 -{ - source="$(2)" - if [ "$(HAIKU_NO_DOWNLOADS)" = 1 ]; then - echo "ERROR: Would need to download $(URL), but HAIKU_NO_DOWNLOADS is set!" +if $(HAIKU_NO_DOWNLOADS) = 1 { + actions DownloadLocatedFile1 + { + source="$(2)" + echo "ERROR: Would need to download $(UR2L), but HAIKU_NO_DOWNLOADS is set!" exit 1 - fi - wget --retry-connrefused --timeout 30 -O "$(1)" $(URL) || exit 1 - touch "$(1)" + } +} else { + actions DownloadLocatedFile1 + { + source="$(2)" + wget --retry-connrefused --timeout 30 -O "$(1)" $(URL) || exit 1 + touch "$(1)" + } } rule DownloadFile file : url : source