From 6e4a47a5a2f92ff74d466e44fb366d0eed21d5fd Mon Sep 17 00:00:00 2001 From: Mark Huang Date: Tue, 6 Feb 2007 15:52:26 +0000 Subject: [PATCH] - remove FC2 repos - provide mirrorlist functionality so that yum never bombs out and so that the boot server doesn't have to maintain an FC4 repo --- yum.conf.php | 66 +++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 57 insertions(+), 9 deletions(-) diff --git a/yum.conf.php b/yum.conf.php index 8cc2b90..0e42509 100755 --- a/yum.conf.php +++ b/yum.conf.php @@ -5,22 +5,19 @@ // 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.1 2006/11/06 22:02:17 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'), - 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 +32,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 <<