56dc0a2c31
We're ending up with "centoscentos" in the mirror location and the build fails; strip out the $contentdir from the original too. Change-Id: If09dbbd8028ea510d2ab0d3d8afe484cea611df5
24 lines
1.3 KiB
Bash
Executable File
24 lines
1.3 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then
|
|
set -x
|
|
fi
|
|
set -eu
|
|
set -o pipefail
|
|
|
|
DIB_DISTRIBUTION_MIRROR=${DIB_DISTRIBUTION_MIRROR:-}
|
|
|
|
[ -n "$DIB_DISTRIBUTION_MIRROR" ] || exit 0
|
|
|
|
# Only set the mirror for the Base, Extras and Updates repositories
|
|
# The others aren't enabled and do not exist on all mirrors
|
|
if [[ ${DIB_RELEASE} == '7' ]]; then
|
|
sed -e "s|^#baseurl=http[s]*://mirror.centos.org/centos|baseurl=$DIB_DISTRIBUTION_MIRROR|;/^mirrorlist=/d" -i /etc/yum.repos.d/CentOS-Base.repo
|
|
elif [[ ${DIB_RELEASE} == '8' ]]; then
|
|
sed -e "s|^#baseurl=http[s]*://mirror.centos.org/\$contentdir/|baseurl=$DIB_DISTRIBUTION_MIRROR/|;/^mirrorlist=/d" -i /etc/yum.repos.d/CentOS-Base.repo
|
|
sed -e "s|^#baseurl=http[s]*://mirror.centos.org/\$contentdir/|baseurl=$DIB_DISTRIBUTION_MIRROR/|;/^mirrorlist=/d" -i /etc/yum.repos.d/CentOS-AppStream.repo
|
|
sed -e "s|^#baseurl=http[s]*://mirror.centos.org/\$contentdir/|baseurl=$DIB_DISTRIBUTION_MIRROR/|;/^mirrorlist=/d" -i /etc/yum.repos.d/CentOS-centosplus.repo
|
|
sed -e "s|^#baseurl=http[s]*://mirror.centos.org/\$contentdir/|baseurl=$DIB_DISTRIBUTION_MIRROR/|;/^mirrorlist=/d" -i /etc/yum.repos.d/CentOS-Extras.repo
|
|
sed -e "s|^#baseurl=http[s]*://mirror.centos.org/\$contentdir/|baseurl=$DIB_DISTRIBUTION_MIRROR/|;/^mirrorlist=/d" -i /etc/yum.repos.d/CentOS-PowerTools.repo
|
|
fi
|