From 07aeed694edd3139c4b19020ddcc73baa341998b 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 (cherry picked from commit b96ebc83d859a4a7802a462504817ecec6182a7b) (cherry picked from commit 7b5f3a45e663866a3c0ca3ca86eb3c92bc7f0210) Change-Id: I79a96ddc8333a2465ba03b1d2abbad9a8b3b58f0 --- 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 295fdc92..e6a7aee3 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" (