From a2ccc588477eafa637acc23bdae94f23e0b5d29b Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Mon, 5 Dec 2022 13:25:22 +0900 Subject: [PATCH] Stable-only: Pin ruby packages in CentOS 8 This change introduces pinning of a few packages to avoid installing versions incompatible with old Ruby 2.5 in CentOS 8. Note that this change is submitted to stable/yoga and older stable branches because CentOS 8 support has been removed during Zed cycle and we no longer have CentOS 8 integration jobs since then. Closes-Bug: #1998739 Change-Id: I1b5ebe109b7d0647f324e84b465ed4960f8749f1 (cherry picked from commit 394084fa22aa50e478206fed9ffc88278ed929f1) (cherry picked from commit b242eceedc72dbec7048496652d8d9c9f6491752) --- install_modules.sh | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/install_modules.sh b/install_modules.sh index 4b2627871..8ba90e56d 100755 --- a/install_modules.sh +++ b/install_modules.sh @@ -1,7 +1,8 @@ #!/bin/bash set -ex - +source /etc/os-release +export OS_NAME_VERS=${ID}${VERSION_ID} GEM_INSTALL_CMD="gem install --no-user-install --minimal-dep --verbose --no-document" if [ -n "${GEM_HOME}" ]; then @@ -25,7 +26,17 @@ source $SCRIPT_DIR/functions print_header 'Start (install_modules.sh)' print_header 'Install r10k' -$GEM_INSTALL_CMD r10k + +if [ "${OS_NAME_VERS}" == "centos8" ]; then + # faraday-net_http >= 3.0.0 supports only Ruby 2.6.0 but CentOS 8 provides + # Ruby 2.5.0 + $GEM_INSTALL_CMD faraday-net_http -v '< 3.0.0' + # Pin a few more packages to avoid updating faraday-net_http + $GEM_INSTALL_CMD faraday -v '< 2.0.0' + $GEM_INSTALL_CMD r10k -v '< 3.15.0' +else + $GEM_INSTALL_CMD r10k +fi # make sure there is no puppet module pre-installed rm -rf "${PUPPETFILE_DIR:?}/"*