X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=yum.conf.php;h=d52a84a91a65c9b091ab9dd428aad98cf94f8006;hb=240f16bdbf35f79e26f53318c085727b4367d243;hp=8cc2b903249ca9da92f3f943eabdeb3a96307540;hpb=ad638a3d9c2530d7bc51b8d41b6f1eb5b3ea6085;p=nodeconfig.git diff --git a/yum.conf.php b/yum.conf.php index 8cc2b90..d52a84a 100755 --- a/yum.conf.php +++ b/yum.conf.php @@ -5,22 +5,24 @@ // Mark Huang // Copyright (C) 2004-2006 The Trustees of Princeton University // -// $Id: yum.conf.php,v 1.3 2006/05/18 23:09:43 mlhuang Exp $ +// $Id: yum.conf.php,v 1.4 2007/02/06 21:29:13 mlhuang Exp $ // // For PLC_NAME and PLC_BOOT_HOST include('plc_config.php'); $PLC_NAME = PLC_NAME; -$BOOT_BASE = PLC_BOOT_HOST; +$PLC_BOOT_HOST = PLC_BOOT_HOST; -$repos = array(array('FedoraCore2Base', 'Fedora Core 2 Base', 'stock-fc2'), +$oldrepos = array(array('FedoraCore2Base', 'Fedora Core 2 Base', 'stock-fc2'), array('FedoraCore2Updates', 'Fedora Core 2 Updates', 'updates-fc2'), array('ThirdParty', 'Third Party RPMS', '3rdparty')); +$repos = array(array('ThirdParty', 'Third Party RPMS', '3rdparty')); + + if (isset($_REQUEST['alpha'])) { $repos[] = array('PlanetLabAlpha', 'PlanetLab Alpha RPMS', 'planetlab-alpha'); - $repos[] = array('FedoraCore2Testing', 'Fedora Core 2 Testing', 'testing-fc2'); } elseif (isset($_REQUEST['beta'])) { $repos[] = array('PlanetLabBeta', 'PlanetLab Beta RPMS', 'planetlab-beta'); } elseif (isset($_REQUEST['rollout'])) { @@ -35,10 +37,46 @@ if (isset($_REQUEST['gpgcheck'])) { $gpgcheck = 0; } +// Requesting a mirror list. Yum bombs out completely if a repository +// is (even temporarily) unavailable, so if CoBlitz is down, provide a +// few more options. Make sure that gpgcheck remains enabled. Last +// chance option is ourselves so that yum never fails. +if (isset($_REQUEST['mirrorlist']) && + isset($_REQUEST['repo']) && + isset($_REQUEST['releasever'])) { + $mirrors = array("http://coblitz.planet-lab.org/pub/fedora/linux", + "http://fedora.gtlib.cc.gatech.edu/pub/fedora.redhat/linux", + "http://download.fedoraproject.org/pub/fedora/linux", + "ftp://rpmfind.net/linux/fedora", + "http://mirrors.kernel.org/fedora"); + $releasever = $_REQUEST['releasever']; + switch ($_REQUEST['repo']) { + case "base": + foreach ($mirrors as $mirror) { + echo "$mirror/core/$releasever/\$ARCH/os/\n"; + } + break; + case "updates": + foreach ($mirrors as $mirror) { + echo "$mirror/core/updates/$releasever/\$ARCH/\n"; + } + break; + case "extras": + foreach ($mirrors as $mirror) { + echo "$mirror/extras/$releasever/\$ARCH/\n"; + } + break; + } + + // Always list ourselves last + echo "http://$PLC_BOOT_HOST/install-rpms/planetlab/\n"; + exit; +} + +// Requesting yum.conf. See above for the mirrorlist definition. echo << \ No newline at end of file +?>