fix bad flockflock url

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 <scott.little@windriver.com>
(cherry picked from commit b96ebc83d8)
(cherry picked from commit 7b5f3a45e6)
Change-Id: I79a96ddc8333a2465ba03b1d2abbad9a8b3b58f0
This commit is contained in:
Scott Little 2021-05-03 13:16:53 -04:00
parent f7f2eb3959
commit 07aeed694e
1 changed files with 4 additions and 1 deletions

View File

@ -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"
(