Browse Source

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
tags/1.1.0
Abel Lopez 4 years ago
parent
commit
570ecf16a5

+ 1
- 0
elements/centos7/environment.d/10-centos7-distro-name.bash View File

@@ -1 +1,2 @@
1
+export DIB_RELEASE=GenericCloud
1 2
 export DISTRO_NAME=centos7

+ 1
- 1
elements/rpm-distro/pre-install.d/01-override-yum-arch View File

@@ -25,7 +25,7 @@ else
25 25
     exit 1
26 26
 fi
27 27
 
28
-if [ $DIB_RELEASE -ge 22 ]; then
28
+if [[ $DISTRO_NAME == "fedora" && $DIB_RELEASE -ge 22 ]]; then
29 29
     mkdir -p /etc/dnf/vars
30 30
     echo $basearch > /etc/dnf/vars/basearch
31 31
     echo $arch > /etc/dnf/vars/basearch

+ 1
- 1
elements/yum/post-install.d/99-reset-yum-conf View File

@@ -6,7 +6,7 @@ fi
6 6
 set -eu
7 7
 set -o pipefail
8 8
 
9
-if [ $DIB_RELEASE -ge 22 ]; then
9
+if [[ $DISTRO_NAME == "fedora" && $DIB_RELEASE -ge 22 ]]; then
10 10
     cfg=/etc/dnf/dnf.conf
11 11
 else
12 12
     cfg=/etc/yum.conf

+ 1
- 1
elements/yum/pre-install.d/01-yum-keepcache View File

@@ -6,7 +6,7 @@ fi
6 6
 set -eu
7 7
 set -o pipefail
8 8
 
9
-if [ $DIB_RELEASE -ge 22 ]; then
9
+if [[ $DISTRO_NAME == "fedora" && $DIB_RELEASE -ge 22 ]]; then
10 10
     # dnf is slightly different; doesn't have these by default
11 11
     cfg=/etc/dnf/dnf.conf
12 12
     echo "keepcache=1" >> $cfg

Loading…
Cancel
Save