# Mark Huang <mlhuang@cs.princeton.edu>
# Copyright (C) 2004-2006 The Trustees of Princeton University
#
-# $Id: mkfedora,v 1.16 2006/07/06 22:55:47 mlhuang Exp $
+# $Id: mkfedora,v 1.17 2006/07/17 21:25:42 mlhuang Exp $
#
export PATH=/sbin:/bin:/usr/sbin:/usr/bin
# Default yum repositories to try
mirrors=(
-file:///usr/share/mirrors/fedora
-file:///var/www/html/mirrors/fedora
-ftp://smoke.cs.princeton.edu/pub/mirrors/fedora
-ftp://128.112.137.30/pub/mirrors/fedora
+file:///data/fedora
http://coblitz.planet-lab.org/pub/fedora
ftp://mirror.cs.princeton.edu/pub/mirrors/fedora
+ftp://mirror.stanford.edu/pub/mirrors/fedora
+ftp://rpmfind.net/linux/fedora
)
# Release and architecture to install
mkdir -p $vroot/proc
mount -t proc none $vroot/proc
+bailout ()
+{
+ cleanup
+ exit $1
+}
+
cleanup ()
{
umount $vroot/proc
# Go, baby, go
if [ ${#packages[*]} -gt 0 ] ; then
- echo "* Installing optional packages" >&3
- yum -c $vroot/etc/yum.conf --installroot=$vroot -y $excludes \
- install "${packages[@]}"
+ echo "* Installing optional packages" "${packages[@]}" >&3
+ yum -c $vroot/etc/yum.conf --installroot=$vroot -y $excludes \
+ install "${packages[@]}"
+ for pkg in "${packages[@]}" ; do
+ echo "Checking installation of $pkg"
+ rpm --root $vroot -q "$pkg" || bailout 1
+ done
fi
if [ ${#groups[*]} -gt 0 ] ; then
- echo "* Installing optional groups" >&3
- yum -c $vroot/etc/yum.conf --installroot=$vroot -y $excludes \
- groupinstall "${groups[@]}"
+ ## call yum sequentially to get finer-grained info on dependencies
+ for grp in "${groups[@]}" ; do
+ echo "* Installing optional group $grp" >&3
+ yum -c $vroot/etc/yum.conf --installroot=$vroot -y $excludes \
+ groupinstall "$grp"
+ done
fi
# FC2 dev %preinstall checks /proc/mounts to make sure that /dev is