+#################### hack yumgroups
+# if we've installed for several flavours
+# we create cross links in install-rpms like this one
+# ./onelab-f8-i386/vserver-onelab-f12-i386-5.0-6.2011.02.03.i686.rpm
+# -> /var/www/html/install-rpms/onelab-f12-i386/vserver-onelab-f12-i386-5.0-6.2011.02.03.i686.rpm
+#
+# but this won't make it to the nodes until they are insered in yumgroups.xml in the PlanetLab group
+#
+
+function hack_yumgroups () {
+ repo=$1; shift
+
+ pushd $repo >& /dev/null
+ pwd
+ vsrpms=$(find . -name 'vserver*rpm')
+ echo found vsrpms $vsrpms
+ if [ ! -f yumgroups.xml ] ; then
+ echo "hack_yumgroups: could not find yumgroups in $(pwd)"
+ elif [ -z "$vsrpms" ] ; then
+ echo "No need to hack yumgroups, no foreign vserver package found"
+ else
+ cp yumgroups.xml yumgroups.xml.hacking
+ # remove references to package vserver-
+ grep -v '>vserver-' yumgroups.xml.hacking > yumgroups.xml
+ # build a list of lines with corresponding rpm names
+ insert=""
+ for vsrpm in $vsrpms; do
+ rpmname=$(rpm -q --qf '%{name}' -p $vsrpm)
+ echo found file $vsrpm with name $rpmname
+ insert="$insert<packagereq type=\"mandatory\">$rpmname</packagereq>"
+ done
+ echo 'inserting' $insert
+ # insert in yumgroups at the right place -- first packages in the PlanetLab group
+ ed yumgroups.xml <<EOF
+1
+/name>PlanetLab<
+/packagelist
++
+i
+$insert
+.
+w
+q
+EOF
+ fi
+ popd >& /dev/null
+}
+
+#################### xxx fixme xxx
+# I'm seeing weird things with f14 nodes and an f8 myplc server
+# I suspect that the f8-based createrepo binary does not do the right thing,
+# as the node (onelab09.pl.sophia.inria.fr) issues a lot of
+# 'package does not match intended content'
+# before reaching this conclusion I have entirely rebuilt the server-side yum repos
+# by (*) checking the gpg keys (*) yum reinstalling all noderepos
+# and on top of that manually re-running createrepo
+# of course the node had gone through yum clean all as well
+####################