Merge "download_mirrors.sh: cengn urls are not validated before substitution"

This commit is contained in:
Zuul 2019-04-18 14:52:08 +00:00 committed by Gerrit Code Review
commit f7a31b5404
1 changed files with 7 additions and 1 deletions

View File

@ -213,7 +213,13 @@ for REPO in $(find "$CENGN_REPOS_DIR" -type f -name '*repo'); do
#
for URL in $(grep '^baseurl=' "$REPO" | sed 's#^baseurl=##'); do
CENGN_URL="$(url_to_stx_mirror_url "$URL" "$DISTRO")"
sed "s#^baseurl=$URL\$#baseurl=$CENGN_URL#" -i "$REPO"
# Test CENGN url
wget -q --spider $CENGN_URL
if [ $? -eq 0 ]; then
# OK, make substitution
sed "s#^baseurl=$URL\$#baseurl=$CENGN_URL#" -i "$REPO"
fi
done
#