From: vasyl Date: Mon, 14 Jun 2021 17:39:50 +0000 (+0300) Subject: aglsetup: Fix append_fragment fails with heredocs on Ubuntu 21.04. X-Git-Tag: 12.90.0~5 X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=commitdiff_plain;h=fac66e3b82213a2147edca7212ca3c0121e2b250;p=AGL%2Fmeta-agl.git aglsetup: Fix append_fragment fails with heredocs on Ubuntu 21.04. Looks like bash creates temporary file for heredocs and passes fd to deleted file to command that use heredocs. Therefore, it is better not to use '[[ -f /dev/stdin ]]' in case of heredocs. Replaced it with more relaxed condition. Bug-AGL: SPEC-3990 Change-Id: Ib68d1510dd6899b0f60b207071b222ef1933bf77 Signed-off-by: vasyl Reviewed-on: https://gerrit.automotivelinux.org/gerrit/c/AGL/meta-agl/+/26428 Tested-by: Jenkins Job builder account ci-image-build: Jenkins Job builder account ci-image-boot-test: Jenkins Job builder account Reviewed-by: Jan-Simon Moeller --- diff --git a/scripts/.aglsetup_genconfig.bash b/scripts/.aglsetup_genconfig.bash index b9f4e5e94..cf06622ba 100755 --- a/scripts/.aglsetup_genconfig.bash +++ b/scripts/.aglsetup_genconfig.bash @@ -223,15 +223,15 @@ function append_fragment() { echo >>$basefile echo "# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #" >>$basefile echo "# fragment { " >>$basefile - [[ -f $f ]] && echo "# $f" >>$basefile || true + [[ -n $f ]] && echo "# $f" >>$basefile || true echo "#" >>$basefile [[ -n "$label" ]] && echo "$label" >>$basefile - [[ -f $f ]] && cat $f >>$basefile || true + [[ -n $f ]] && cat $f >>$basefile || true echo "" >>$basefile echo "#" >>$basefile echo "# }" >>$basefile echo "# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #" >>$basefile - [[ -f $f ]] && echo $f >>$BUILDDIR/conf/fragments.log || true + [[ -n $f ]] && echo $f >>$BUILDDIR/conf/fragments.log || true } function execute_setup() {