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>
Change-Id: I2404b3415f0f3e2f395c2bcb7a527aa01a488f61
This commit is contained in:
Scott Little 2021-05-03 13:16:53 -04:00
parent 4c3ee114bc
commit b96ebc83d8
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"
(