From 87a92d42cee68cd78e99e99b713299a53589e73f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20L=C3=A9tourneau?= Date: Mon, 30 Mar 2015 18:19:27 -0400 Subject: [PATCH 1/2] =?UTF-8?q?Added=20a=20more=20reliable=20test=20for=20?= =?UTF-8?q?yum=20--releasever=20in=20the=20centos=20template=20Signed-off-?= =?UTF-8?q?by:=20Alexandre=20L=C3=A9tourneau=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- templates/lxc-centos.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/lxc-centos.in b/templates/lxc-centos.in index 1588042eb..85d4f3768 100644 --- a/templates/lxc-centos.in +++ b/templates/lxc-centos.in @@ -413,10 +413,10 @@ download_centos() # download a mini centos into a cache echo "Downloading centos minimal ..." - if [ $release -le 5 ];then - YUM="yum --installroot $INSTALL_ROOT -y --nogpgcheck" - else + if [ $(yum -h | grep 'releasever=RELEASEVER') ];then YUM="yum --installroot $INSTALL_ROOT -y --nogpgcheck --releasever=$release" + else + YUM="yum --installroot $INSTALL_ROOT -y --nogpgcheck" fi PKG_LIST="yum initscripts passwd rsyslog vim-minimal openssh-server openssh-clients dhclient chkconfig rootfiles policycoreutils" From 85ccd3d569dcafc4bff3b45798935e1d8fa02ddf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20L=C3=A9tourneau?= Date: Wed, 1 Apr 2015 18:22:50 -0400 Subject: [PATCH 2/2] Now including grep -q Signed-off-by: Alexandre Letourneau --- templates/lxc-centos.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/lxc-centos.in b/templates/lxc-centos.in index 85d4f3768..b489e0e15 100644 --- a/templates/lxc-centos.in +++ b/templates/lxc-centos.in @@ -413,7 +413,7 @@ download_centos() # download a mini centos into a cache echo "Downloading centos minimal ..." - if [ $(yum -h | grep 'releasever=RELEASEVER') ];then + if yum -h | grep -q 'releasever=RELEASEVER'; then YUM="yum --installroot $INSTALL_ROOT -y --nogpgcheck --releasever=$release" else YUM="yum --installroot $INSTALL_ROOT -y --nogpgcheck"