Merge pull request #5438 from dhiltgen/fix_centos_7_build

Centos 7 EOL broke mirrors
This commit is contained in:
Daniel Hiltgen 2024-07-02 09:28:00 -07:00 committed by GitHub
commit 8e277b72bb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -6,10 +6,21 @@ set -ex
MACHINE=$(uname -m) MACHINE=$(uname -m)
if grep -i "centos" /etc/system-release >/dev/null; then if grep -i "centos" /etc/system-release >/dev/null; then
# As of 7/1/2024 mirrorlist.centos.org has been taken offline, so adjust accordingly
sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/*.repo
sed -i s/^#.*baseurl=http/baseurl=http/g /etc/yum.repos.d/*.repo
sed -i s/^mirrorlist=http/#mirrorlist=http/g /etc/yum.repos.d/*.repo
# Centos 7 derivatives have too old of a git version to run our generate script # Centos 7 derivatives have too old of a git version to run our generate script
# uninstall and ignore failures # uninstall and ignore failures
yum remove -y git yum remove -y git
yum -y install epel-release centos-release-scl yum -y install epel-release centos-release-scl
# The release packages reinstate the mirrors, undo that again
sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/*.repo
sed -i s/^#.*baseurl=http/baseurl=http/g /etc/yum.repos.d/*.repo
sed -i s/^mirrorlist=http/#mirrorlist=http/g /etc/yum.repos.d/*.repo
yum -y install dnf yum -y install dnf
if [ "${MACHINE}" = "x86_64" ]; then if [ "${MACHINE}" = "x86_64" ]; then
yum -y install https://repo.ius.io/ius-release-el7.rpm yum -y install https://repo.ius.io/ius-release-el7.rpm