#################### (fedora) distributions
#
# (*) as of nov. 2007, myplc-devel is deprecated
-# (*) instead, we create a fresh vserver that holds required tools (see e.g. planetlab-fc6-devel.lst)
+# (*) instead, we create a fresh vserver that holds required tools (see e.g. planetlab-devel.lst)
# (*) the build uses the current fedora version as a target for the produced images
# (*) so you simply need to create a fedora 8 build image for building fedora-8 images
#
done
}
+########## .lst format
+# comments start with a # - this is needed only if you use a keyword in a comment
+# lst_parse keyword fcdistro lst1 .. lstn
+# for a given keyword like 'package' :
+# we support fcdistro-dependant format, for tokens (pkgname) without whitespace
+# you can e.g. use
+# package: pkg1 .. pkgn
+# package+f8: pkg1 .. pkgn
+# package-f8: pkg1 .. pkgn
+
+function lst_parse () {
+
+ keyword=$1;shift
+ fcdistro=$1; shift
+
+ # grab regular descriptions
+ all=$(grep -v '^#' "$@" | grep --regexp="^${keyword}:" | sed -e "s,${keyword}:,,")
+ # grab additions
+ add=$(grep -v '^#' "$@" | grep --regexp="^${keyword}+${fcdistro}:" | sed -e "s,${keyword}\+${fcdistro}:,,")
+ # grab exclusions
+ sub=$(grep -v '^#' "$@" | grep --regexp="^${keyword}\-${fcdistro}:" | sed -e "s,${keyword}\-${fcdistro}:,,")
+
+ for i in $all $add; do
+ for exclude in $sub; do
+ [ "$i" = "$exclude" ] && continue 2
+ done
+ echo "$i "
+ done
+ return 0
+}
+
+function pl_getPackages2() { fcdistro=$1; shift ; lst_parse package $fcdistro "$@" }
+function pl_getGroups2() { fcdistro=$1; shift ; lst_parse group $fcdistro "$@" }
+
function pl_getPackages() {
filename=$1
packages=$(grep "^package:" $filename | sed -e s,package:,,)
package: less
package: sudo
package: openssh
+# for spec2make / rpmlib
+package+f8: popt-devel
# for vsys
package: ocaml ocaml-ocamldoc
package: expat-devel
COMMAND=$(basename $0)
+# lst parsing utilities
+PATH=$(dirname $0):$PATH . build.common
+
function failure () {
echo "$COMMAND : Bailing out"
exit 1
personality=$1; shift
# check for .lst file based on pldistro
- lst=${pldistro}-${fcdistro}-devel.lst
+ lst=${pldistro}-devel.lst
if [ -f $lst ] ; then
echo "$COMMAND: Using $lst"
else
fi
# install individual packages, then groups
- packages=$(grep "^package:" $lst | sed -e s,package:,,)
- groups=$(grep "^group:" $lst | sed -e s,group:,,)
+ packages=$(pl_getPackages2 ${fcdistro} $lst)
+ groups=$(pl_getGroups2 ${fcdistro} $lst)
[ -n "$packages" ] && $personality vserver $vserver exec yum -y install $packages
[ -n "$groups" ] && $personality vserver $vserver exec yum -y groupinstall $groups
### extract vbuild-init-vserver.sh and run it
svn cat $SVNPATH/vbuild-init-vserver.sh > /tmp/vbuild-init-vserver-$$.sh
# get .lst
- lst=${PLDISTRO}-${FCDISTRO}-devel.lst
+ lst=${PLDISTRO}-devel.lst
svn cat $SVNPATH/$lst > /tmp/$lst
# Create vserver
rm -f /tmp/vbuild-init-vserver-$$.sh /tmp/$lst
cd -
# Extract build
- vserver ${BASE} exec svn checkout ${SVNPATH} /build
+ vserver ${BASE} exec svn export ${SVNPATH} /build
fi
echo "XXXXXXXXXX $COMMAND: preparation of vserver $BASE done" $(date)