Merge "Fix download of lower layer rpms" into r/stx.7.0

This commit is contained in:
Zuul 2023-08-03 15:04:45 +00:00 committed by Gerrit Code Review
commit 55730641a2
1 changed files with 11 additions and 0 deletions

View File

@ -239,6 +239,12 @@ CENGN_HOST="mirror.starlingx.cengn.ca"
CENGN_PORT="80"
CENGN_URL_ROOT="mirror"
to_regex () {
# Currently only care about one case
# convert '.' to '[.]'
echo $1 | sed 's#[.]#[.]#g'
}
url_to_stx_mirror_url () {
local URL="$1"
local DISTRO="$2"
@ -250,6 +256,11 @@ url_to_stx_mirror_url () {
return 1
fi
if [[ ${URL} =~ $(to_regex ${CENGN_HOST}) ]]; then
echo "${URL}"
return 0
fi
FS_PATH="$(repo_url_to_sub_path "$URL")"
if [ $? -ne 0 ]; then
>&2 echo "Error: $FUNCNAME (${LINENO}): repo_url_to_sub_path '$URL'"