From b96ebc83d859a4a7802a462504817ecec6182a7b Mon Sep 17 00:00:00 2001 From: Scott Little Date: Mon, 3 May 2021 13:16:53 -0400 Subject: [PATCH] fix bad flockflock url MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit download_mirror.sh fails due to a bad path containing ‘stx-tools/centos-mirror-tools/config/centos/flockflock’ The path is constructed, and the trigger is when an EOL is missing from a centos_build_layer.cfg file, causing 'cat' to merge the last line of the offending file with the first line of the next file. Switch 'cat' to 'grep', which will always ensure an EOL is present. Along the way, we can filter out empty lines and comments. Closes-bug: 1926987 Signed-off-by: Scott Little Change-Id: I2404b3415f0f3e2f395c2bcb7a527aa01a488f61 --- toCOPY/lst_utils.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/toCOPY/lst_utils.sh b/toCOPY/lst_utils.sh index 295fdc923..a3bb86c35 100644 --- a/toCOPY/lst_utils.sh +++ b/toCOPY/lst_utils.sh @@ -52,7 +52,10 @@ merge_lst () { return 1 fi - layers=$(cat ${layer_cfgs} | sort --unique) + # Grep to ignore empty lines or whole line comments. + # Sed to drop any trailing comments. + # Side effect of grep over cat is adding any missing EOL. + layers=$(grep -h -v -e '^$' -e '^[ \t]*#' ${layer_cfgs} | sed -e 's/[ \t]*#.*$//'} | sort --unique) layers+=" mock" (