From 407128b94c40c159899810fbf4e93fa922980cdb Mon Sep 17 00:00:00 2001 From: Hector Palacios Date: Tue, 11 Sep 2018 10:46:23 +0200 Subject: [PATCH] build-github: fix construction of variables from platforms with dashes Commit d981f999f0afc245002f7a81cf445350854afece introduced a new platform with dashes on its name, which broke Jenkins build because middle variables are being created using the name of the platform and dashes are not allowed in bash variable names. To fix it, this commit changes the dashes to underscores on the fly. This is ported from a2092450faaa6bc332d08a56cf3e49b97755dc3c. Signed-off-by: Hector Palacios --- sdk/build-github.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sdk/build-github.sh b/sdk/build-github.sh index 2da93e40b..6566d0912 100755 --- a/sdk/build-github.sh +++ b/sdk/build-github.sh @@ -117,7 +117,9 @@ swu_recipe_name() { # Per-platform data while read _pl _tgt; do [ -n "${DY_TARGET}" ] && _tgt="${DY_TARGET}" || true - eval "${_pl}_tgt=\"${_tgt}\"" + # Dashes are not allowed in variables so let's substitute them on + # the fly with underscores. + eval "${_pl//-/_}_tgt=\"${_tgt//,/ }\"" done<<-_EOF_ ccimx8x-sbc-express dey-image-qt ccimx6qpsbc dey-image-qt @@ -159,7 +161,9 @@ fi # Create projects and build rm -rf ${YOCTO_IMGS_DIR} ${YOCTO_PROJ_DIR} for platform in ${DY_PLATFORMS}; do - eval platform_targets="\${${platform}_tgt}" + # The variables _var|tgt got their dashes converted to + # underscores, so we must convert also the ones in ${platform}. + eval platform_targets=\"\${${platform//-/_}_tgt}\" _this_prj_dir="${YOCTO_PROJ_DIR}/${platform}" _this_img_dir="${YOCTO_IMGS_DIR}/${platform}" mkdir -p ${_this_img_dir} ${_this_prj_dir}