From 570ecf16a593a6dc75e2ad0f31b28043aaa548ed Mon Sep 17 00:00:00 2001 From: Abel Lopez Date: Thu, 23 Jul 2015 12:26:53 -0700 Subject: [PATCH] Set and export DIB_RELEASE for centos7 The default value was set in the centos7 element, but not exported, which caused issues in rpm-distro. Also changed a test in rpm-distro to only check for DIB_RELEASE > 22 if it's fedora. Closes-Bug: #1477172 Change-Id: Ib6f4227411c2e8f1965c3b78bc318512c59a7876 --- elements/centos7/environment.d/10-centos7-distro-name.bash | 1 + elements/rpm-distro/pre-install.d/01-override-yum-arch | 2 +- elements/yum/post-install.d/99-reset-yum-conf | 2 +- elements/yum/pre-install.d/01-yum-keepcache | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/elements/centos7/environment.d/10-centos7-distro-name.bash b/elements/centos7/environment.d/10-centos7-distro-name.bash index 16184a3f0..1afdc622e 100644 --- a/elements/centos7/environment.d/10-centos7-distro-name.bash +++ b/elements/centos7/environment.d/10-centos7-distro-name.bash @@ -1 +1,2 @@ +export DIB_RELEASE=GenericCloud export DISTRO_NAME=centos7 diff --git a/elements/rpm-distro/pre-install.d/01-override-yum-arch b/elements/rpm-distro/pre-install.d/01-override-yum-arch index 9e9576995..ff84375c6 100755 --- a/elements/rpm-distro/pre-install.d/01-override-yum-arch +++ b/elements/rpm-distro/pre-install.d/01-override-yum-arch @@ -25,7 +25,7 @@ else exit 1 fi -if [ $DIB_RELEASE -ge 22 ]; then +if [[ $DISTRO_NAME == "fedora" && $DIB_RELEASE -ge 22 ]]; then mkdir -p /etc/dnf/vars echo $basearch > /etc/dnf/vars/basearch echo $arch > /etc/dnf/vars/basearch diff --git a/elements/yum/post-install.d/99-reset-yum-conf b/elements/yum/post-install.d/99-reset-yum-conf index e36bcc394..9535cdde3 100755 --- a/elements/yum/post-install.d/99-reset-yum-conf +++ b/elements/yum/post-install.d/99-reset-yum-conf @@ -6,7 +6,7 @@ fi set -eu set -o pipefail -if [ $DIB_RELEASE -ge 22 ]; then +if [[ $DISTRO_NAME == "fedora" && $DIB_RELEASE -ge 22 ]]; then cfg=/etc/dnf/dnf.conf else cfg=/etc/yum.conf diff --git a/elements/yum/pre-install.d/01-yum-keepcache b/elements/yum/pre-install.d/01-yum-keepcache index f02e17e39..8105ce5e9 100755 --- a/elements/yum/pre-install.d/01-yum-keepcache +++ b/elements/yum/pre-install.d/01-yum-keepcache @@ -6,7 +6,7 @@ fi set -eu set -o pipefail -if [ $DIB_RELEASE -ge 22 ]; then +if [[ $DISTRO_NAME == "fedora" && $DIB_RELEASE -ge 22 ]]; then # dnf is slightly different; doesn't have these by default cfg=/etc/dnf/dnf.conf echo "keepcache=1" >> $cfg