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.
This commit is contained in:
Augustin Cavalier
2019-01-09 19:18:27 -05:00
parent 4293d6b7da
commit 134e58ec8d
+8 -3
View File
@@ -442,16 +442,21 @@ rule DownloadLocatedFile target : url : source
DownloadLocatedFile1 $(target) : $(source) ; DownloadLocatedFile1 $(target) : $(source) ;
} }
if $(HAIKU_NO_DOWNLOADS) = 1 {
actions DownloadLocatedFile1 actions DownloadLocatedFile1
{ {
source="$(2)" source="$(2)"
if [ "$(HAIKU_NO_DOWNLOADS)" = 1 ]; then echo "ERROR: Would need to download $(UR2L), but HAIKU_NO_DOWNLOADS is set!"
echo "ERROR: Would need to download $(URL), but HAIKU_NO_DOWNLOADS is set!"
exit 1 exit 1
fi }
} else {
actions DownloadLocatedFile1
{
source="$(2)"
wget --retry-connrefused --timeout 30 -O "$(1)" $(URL) || exit 1 wget --retry-connrefused --timeout 30 -O "$(1)" $(URL) || exit 1
touch "$(1)" touch "$(1)"
} }
}
rule DownloadFile file : url : source rule DownloadFile file : url : source
{ {