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 17:59:03 -05:00
parent 4293d6b7da
commit 134e58ec8d
1 changed files with 13 additions and 8 deletions

View File

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