diff --git a/ci/distribution-patched.sh b/ci/distribution-patched.sh index f258a7238..edc0ee339 100755 --- a/ci/distribution-patched.sh +++ b/ci/distribution-patched.sh @@ -4,9 +4,12 @@ if grep CODENAME=stretch /etc/os-release; then echo "deb http://archive.debian.org/debian-archive/debian stretch main" >/etc/apt/sources.list echo "deb http://archive.debian.org/debian-archive/debian stretch-backports main" >>/etc/apt/sources.list fi - if grep "CentOS Linux 7" /etc/os-release; then - sed -i 's/mirror.centos.org/vault.centos.org/;/^mirrorlist/d;s/^#baseurl/baseurl/' /etc/yum.repos.d/CentOS-Base.repo - fi +if [ -f /etc/centos-release ]; then + _version=$(cat /etc/centos-release | cut -d' ' -f3 | cut -d. -f1) + if [ "$_version" = "6" ] || [ "$_version" = "7" ]; then + sed -i 's/mirror.centos.org/vault.centos.org/;/^mirrorlist/d;s/^#baseurl/baseurl/' /etc/yum.repos.d/CentOS-Base.repo + fi +fi if command -v yum; then yum -e 0 -d 0 -y update yum -e 0 -d 0 -y install git rsync diff --git a/ci/linux-install-jdk21.sh b/ci/linux-install-jdk21.sh index 43c3ccabd..f3a75c842 100755 --- a/ci/linux-install-jdk21.sh +++ b/ci/linux-install-jdk21.sh @@ -15,7 +15,7 @@ install_jdk() { sha=267b10b14b4e5fada19aca3be3b961ce4f81f1bd3ffcd070e90a5586106125eb fi wget --quiet "$baseurl$tarball" - echo "$sha" "$tarball" | sha256sum --check - + echo "$sha $tarball" | sha256sum --check - tar xf "$tarball" tee /etc/profile.d/jdk.sh << EOF export JAVA_HOME="/opt/jdk-$version" diff --git a/ci/setup-cfengine-build-host.sh b/ci/setup-cfengine-build-host.sh index 62563f7f2..b32ed6248 100755 --- a/ci/setup-cfengine-build-host.sh +++ b/ci/setup-cfengine-build-host.sh @@ -3,33 +3,40 @@ shopt -s expand_aliases # Use the newest CFEngine version we can CFE_VERSION=3.26.0 -source /etc/os-release -if [ "$ID" = "debian" ]; then - if [ "$VERSION_ID" -lt "9" ]; then - echo "Platform $ID $VERSION_ID is too old." - exit 9 - fi - if [ "$VERSION_ID" -lt "11" ]; then - CFE_VERSION=3.21.7 - fi -fi -if [ "$ID" = "redhat" ] || [ "$ID" = "centos" ]; then - if [ "$VERSION_ID" -lt "6" ]; then - echo "Platform $ID $VERSION_ID is too old." - exit 9 - fi - if [ "$VERSION_ID" -lt "7" ]; then +if [ -f /etc/centos-release ]; then + _version=$(cat /etc/centos-release | cut -d' ' -f3 | cut -d. -f1) + if [ "$_version" = "6" ]; then CFE_VERSION=3.24.2 fi -fi -if [ "$ID" = "ubuntu" ]; then - _version=$(echo $VERSION_ID | cut -d. -f1) - if [ "$_version" -lt "16" ]; then - echo "Platform $ID $VERSION_ID is too old." - exit 9 +elif [ -f /etc/os-release ]; then + source /etc/os-release + if [ "$ID" = "debian" ]; then + if [ "$VERSION_ID" -lt "9" ]; then + echo "Platform $ID $VERSION_ID is too old." + exit 9 + fi + if [ "$VERSION_ID" -lt "11" ]; then + CFE_VERSION=3.21.7 + fi + fi + if [ "$ID" = "redhat" ] || [ "$ID" = "centos" ]; then + if [ "$VERSION_ID" -lt "6" ]; then + echo "Platform $ID $VERSION_ID is too old." + exit 9 + fi + if [ "$VERSION_ID" -lt "7" ]; then + CFE_VERSION=3.24.2 + fi fi - if [ "$_version" -lt "20" ]; then - CFE_VERSION=3.21.7 + if [ "$ID" = "ubuntu" ]; then + _version=$(echo $VERSION_ID | cut -d. -f1) + if [ "$_version" -lt "16" ]; then + echo "Platform $ID $VERSION_ID is too old." + exit 9 + fi + if [ "$_version" -lt "20" ]; then + CFE_VERSION=3.21.7 + fi fi fi