# Be verbose
set -x
+# 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
+
function yum_conf_to_build_host () {
- BUILD_HOST=$(hostname)
- cat <<EOF
+ build_dir=$1; shift
+ BUILD_HOST=$(hostname)
+
+ cat <<EOF
[main]
cachedir=/var/cache/yum
debuglevel=2
# (e.g., from /etc/yum.repos.d/)
reposdir=/dev/null
-[base]
-name=Fedora Core 4 - i386 - base
-baseurl=http://${BUILD_HOST}/fedora/linux/core/${pl_DISTRO_RELEASE}/${pl_DISTRO_ARCH}/os/
-
-
-[updates]
-name=Fedora Core 4 - i386 - updates
-baseurl=http://${BUILD_HOST}/fedora/linux/core/updates/${pl_DISTRO_RELEASE}/${pl_DISTRO_ARCH}/
-
-$(if [ "${pl_DISTRO_RELEASE}" -le 6 ] ; then cat << EXTRAS
-[extras]
-name=Fedora Core 4 - i386 - extras
-baseurl=http://${BUILD_HOST}/fedora/linux/extras/${pl_DISTRO_RELEASE}/${pl_DISTRO_ARCH}/
-EXTRAS
-fi)
EOF
-}
-
-function sudoers_bootcustom_apache () {
- cat <<EOF
-User_Alias WWW = %apache,%root
-Cmnd_Alias BOOTCUSTOM = /usr/share/bootcd/bootcustom.sh
-WWW ALL = NOPASSWD: BOOTCUSTOM
-EOF
+ 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
}
# quick and dirty - might break anytime if docbook html output changes