3 # Common functions for MyPLC build scripts (build_devel.sh and
6 # Mark Huang <mlhuang@cs.princeton.edu>
7 # Copyright (C) 2006 The Trustees of Princeton University
12 PATH=/sbin:/bin:/usr/sbin:/usr/bin
14 # In both a normal CVS environment and a PlanetLab RPM
15 # build environment, all of our dependencies are checked out into
16 # directories at the same level as us.
17 if [ -d ../build ] ; then
21 echo "Error: Could not find $(cd .. && pwd -P)/build/"
29 pl_process_fedora_options $@
33 # XXX Backwards compatibility with old myplc-devel environment
34 # We may be running inside a myplc-devel environment, which can
35 # override these defaults.
36 if [ -f /etc/planetlab/plc_config ] ; then
37 . /etc/planetlab/plc_config
38 [ ! -z "$PLC_DEVEL_FEDORA_RELEASE" ] && pl_FEDORA_RELEASE=$PLC_DEVEL_FEDORA_RELEASE
39 [ ! -z "$PLC_DEVEL_FEDORA_ARCH" ] && pl_FEDORA_ARCH=$PLC_DEVEL_FEDORA_ARCH
40 [ ! -z "$PLC_DEVEL_FEDORA_URL" ] && pl_FEDORA_URL=$PLC_DEVEL_FEDORA_URL
43 # Do not tolerate errors
49 # this is fragile, as the actual layout may vary from one mirror to the other
50 # however this should be in line with the layouts obtained
51 # when running build/vbuild-fedora-mirror.sh
53 function yum_conf_to_build_host () {
55 BUILD_HOST=$(hostname)
59 cachedir=/var/cache/yum
61 logfile=/var/log/yum.log
63 distroverpkg=redhat-release
69 # Prevent yum-2.4 from loading additional repository definitions
70 # (e.g., from /etc/yum.repos.d/)
75 template=$build_dir/mirroring/${pl_DISTRO_NAME}/yum.repos.d/building.repo.in
76 if [ ! -f $template ] ; then
77 echo "# MyPLC/$0: cannot find template $template"
79 sed -e s,@MIRRORURL@,http://${BUILD_HOST}/mirror/, $template