]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
Added a more reliable test for yum --releasever in the centos template
authorAlexandre Létourneau <letourneau.alexandre@gmail.com>
Mon, 30 Mar 2015 22:19:27 +0000 (18:19 -0400)
committerStéphane Graber <stgraber@ubuntu.com>
Fri, 10 Apr 2015 15:28:15 +0000 (11:28 -0400)
Signed-off-by: Alexandre Létourneau <letourneau.alexandre@gmail.com>
templates/lxc-centos.in

index 1588042ebb0f88238e6994b970d12ad97a118ba6..85d4f3768057d5344cc284b50231fbe7260a6dfd 100644 (file)
@@ -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"