# Mark Huang <mlhuang@cs.princeton.edu>
# Copyright (C) 2006 The Trustees of Princeton University
#
-# $Id: build.functions,v 1.10.2.1 2007/08/30 16:39:07 mef Exp $
+# $Id$
#
PATH=/sbin:/bin:/usr/sbin:/usr/bin
# Be verbose
set -x
-# Make a basic chroot at the specified location given the specified
-# configuration.
-make_chroot() {
- root=$1
- config=$2
+# this is fragile, as the actual layout may vary from one mirror to the other
+# however this should be in line with the layouts obtained
+# when running build/vbuild-fedora-mirror.sh
- # Get group list
- groups=
- while read group ; do
- groups="$groups -g \"$group\""
- done < <(./plc-config --groups $config)
+function yum_conf_to_build_host () {
+ build_dir=$1; shift
+ BUILD_HOST=$(hostname)
- # Get package list
- packages=
- while read package ; do
- packages="$packages -p \"$package\""
- done < <(./plc-config --packages $config)
+ cat <<EOF
+[main]
+cachedir=/var/cache/yum
+debuglevel=2
+logfile=/var/log/yum.log
+pkgpolicy=newest
+distroverpkg=redhat-release
+tolerant=1
+exactarch=1
+retries=10
+obsoletes=1
+gpgcheck=0
+# Prevent yum-2.4 from loading additional repository definitions
+# (e.g., from /etc/yum.repos.d/)
+reposdir=/dev/null
- pl_setup_chroot $root $packages $groups
-}
+EOF
-# Move specified directories out of the chroot and into a "data"
-# directory that will be bind mounted on /data inside the chroot.
-move_datadirs() {
- root=$1
- data=$2
- shift 2
- pl_move_dirs $root $data /data "$@"
+ template=$build_dir/mirroring/${pl_DISTRO_NAME}/yum.repos.d/building.repo.in
+ if [ ! -f $template ] ; then
+ echo "# MyPLC/$0: cannot find template $template"
+ else
+ sed -e s,@MIRRORURL@,http://${BUILD_HOST}/mirror/, $template
+ fi
}
-# Make loopback filesystem from specified location
-make_image() {
- root=$1
- image=$2
- pl_make_image $root $image 100000000
-}