implemented api query filters
[nodeconfig.git] / yum.conf.php
1 <?php
2 //
3 // /etc/yum.conf for production nodes
4 //
5 // Mark Huang <mlhuang@cs.princeton.edu>
6 // Copyright (C) 2004-2006 The Trustees of Princeton University
7 //
8 // $Id: yum.conf.php,v 1.3 2006/05/18 23:09:43 mlhuang Exp $
9 //
10
11 // For PLC_NAME and PLC_BOOT_HOST
12 include('plc_config.php');
13
14 $PLC_NAME = PLC_NAME;
15 $BOOT_BASE = PLC_BOOT_HOST;
16
17 $repos = array(array('FedoraCore2Base', 'Fedora Core 2 Base', 'stock-fc2'),
18                array('FedoraCore2Updates', 'Fedora Core 2 Updates', 'updates-fc2'),
19                array('ThirdParty', 'Third Party RPMS', '3rdparty'));
20
21 if (isset($_REQUEST['alpha'])) {
22   $repos[] = array('PlanetLabAlpha', 'PlanetLab Alpha RPMS', 'planetlab-alpha');
23   $repos[] = array('FedoraCore2Testing', 'Fedora Core 2 Testing', 'testing-fc2');
24 } elseif (isset($_REQUEST['beta'])) {
25   $repos[] = array('PlanetLabBeta', 'PlanetLab Beta RPMS', 'planetlab-beta');
26 } elseif (isset($_REQUEST['rollout'])) {
27   $repos[] = array('PlanetLab', 'PlanetLab RPMS', 'planetlab-rollout');
28 } else {
29   $repos[] = array('PlanetLab', 'PlanetLab RPMS', 'planetlab');
30 }
31
32 if (isset($_REQUEST['gpgcheck'])) {
33   $gpgcheck = $_REQUEST['gpgcheck'];
34 } else {
35   $gpgcheck = 0;
36 }
37
38 echo <<<EOF
39 [main]
40 ### for yum-2.4 in fc4 (this will be ignored by yum-2.0)
41 ### everything in here, do not scan /etc/yum.repos.d/
42 reposdir=/dev/null
43 cachedir=/var/cache/yum
44 debuglevel=2
45 logfile=/var/log/yum.log
46 pkgpolicy=newest
47 gpgcheck=$gpgcheck
48
49
50 EOF;
51
52 // Figure out which repositories we actually have on this
53 // machine. MyPLC installations, for instance, generally only have
54 // PlanetLab RPMS installed.
55 foreach ($repos as $repo) {
56   $id = $repo[0];
57   $name = $repo[1] . " -- " . "$PLC_NAME Central";
58   $dir = "/install-rpms/" . $repo[2];
59   $baseurl = "http://$BOOT_BASE" . $dir . "/";
60
61   if (is_dir(realpath($_SERVER['DOCUMENT_ROOT'] . $dir))) {
62     echo <<<EOF
63 [$id]
64 name=$name
65 baseurl=$baseurl
66 gpgcheck=$gpgcheck
67
68
69 EOF;
70   }
71 }
72
73 ?>