From: Mark Huang <mlhuang@cs.princeton.edu>
Date: Wed, 29 Mar 2006 17:02:00 +0000 (+0000)
Subject: - fix cases when yum-arch and/or createrepo don't exist
X-Git-Tag: myplc-0_4-rc1~110
X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=0af7d4a2b4da6e949b7c2fd1554f6196d3ba0f76;p=myplc.git

- fix cases when yum-arch and/or createrepo don't exist
---

diff --git a/build.sh b/build.sh
index 63e9bbe..c869ec5 100755
--- a/build.sh
+++ b/build.sh
@@ -241,8 +241,17 @@ if [ -n "$RPM_BUILD_DIR" ] ; then
 	install -D -m 644 $RPM_RPMS_DIR/yumgroups.xml \
 	    $data/var/www/html/install-rpms/planetlab/yumgroups.xml
     fi
-    yum-arch $data/var/www/html/install-rpms/planetlab || :
-    createrepo $data/var/www/html/install-rpms/planetlab || :
+    # yum-2.0.x
+    if [ -x /usr/bin/yum-arch ] ; then
+	yum-arch $data/var/www/html/install-rpms/planetlab
+    fi
+    # yum-2.4.x
+    if [ -x /usr/bin/createrepo ] ; then
+	if [ -f $data/var/www/html/install-rpms/planetlab/yumgroups.xml ] ; then
+	    groupfile="-g yumgroups.xml"
+	fi
+	createrepo $groupfile $data/var/www/html/install-rpms/planetlab
+    fi
 fi
 
 # Bootstrap the system for quicker startup (and to populate the