summaryrefslogtreecommitdiff
path: root/tcwg-buildfarm.sh
diff options
context:
space:
mode:
authorChristophe Lyon <christophe.lyon@linaro.org>2018-06-19 20:26:35 +0000
committerChristophe Lyon <christophe.lyon@linaro.org>2018-06-27 14:08:14 +0000
commit08cdb2b1c9d5ca56f3e5f90b24bb98c082717231 (patch)
treed106977f56d2f59627f9d71599d3a4af80115d34 /tcwg-buildfarm.sh
parenta08aaa4e9f44d14e853dbec77e33b1e01ea0f340 (diff)
tcwg-buildfarm.sh: Fix "host" (former builder_type) expansion.
Since we assume this script is executed inside a container, we pass all parameters on the command line, which complicates the expansion of host if used in log_name. This patch fixes that by using a sed trick to replace @@host@@ with the value of host computed when possible. Change-Id: Iba2f442d7614b9516be8e913f68d8eec0cfe1a37
Diffstat (limited to 'tcwg-buildfarm.sh')
-rwxr-xr-xtcwg-buildfarm.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/tcwg-buildfarm.sh b/tcwg-buildfarm.sh
index 7e6f89d9..535a82eb 100755
--- a/tcwg-buildfarm.sh
+++ b/tcwg-buildfarm.sh
@@ -38,6 +38,13 @@ dryrun="${dryrun:-false}"
# so enable "set -u" only after above binding of variables.
set -u
+# Compute host (builder type) because it is/can be used when computing
+# log_name. It would be better to define host before defining log_name
+# in convert_args_to_variables, but label is also defined by
+# convert_args_to_variables, so we have to patch host in log_name via
+# a sed trick later.
+host=$(print_type_for_label $label)
+
if [ x"$target" = x"$label" ]; then
target_opt="--target native"
elif [ x"$target" = x"aarch64-linux-gnu_ilp32" ]; then
@@ -92,6 +99,9 @@ else
fi
if [ x"$log_name" != x"" ]; then
+ # As explained above, host is defined too late and cannot be
+ # expanded when we define log_name, so use a sed trick.
+ log_name=$(echo $log_name | sed 's/@@host@@/$host/g')
eval "logname_opt=\"--logname $log_name\""
fi