I updated a centos machine from this code... you ripper, it works!
[glcas.git] / plugins / knownos.php
1 <?php
2
3 // this class will provide OS knowledge - though how i have no idea yet
4 class GLCASKnownOS {
5         
6         function __construct()
7         {
8                 $knownOS = getKnownOSList();
9         }
10         
11         function getOSList()
12         {
13         }
14         
15         function getRepoTypeForOS($os)
16         {
17                 
18         }
19         
20         function getRepoTypes()
21         {
22                 
23         }
24         
25         public $knownOS;
26 }
27
28 function getKnownOSList()
29 {
30         // repo types
31         $kos["repotype"]["yum"] = "Yellowdog Updater Modified";
32         $kos["repotype"]["apt"] = "APT";
33
34         // repo providers
35         $kos["repotype"]["yum"][0] = "baseurl";
36         $kos["repotype"]["yum"][1] = "mirrorlist";
37         $kos["repotype"]["apt"][0] = "baseurl";
38         
39         // OS's
40         $kos["os"]["short"]["fedora"] = "Fedora";
41         $kos["os"]["short"]["debian"] = "Debian";
42         $kos["os"]["short"]["redhat"] = "RedHat";
43         $kos["os"]["short"]["ubuntu"] = "Ubuntu";
44         $kos["os"]["short"]["centos"] = "CentOS";
45         $kos["os"]["fedora"]["long"] = "Fedora";
46         $kos["os"]["debian"]["long"] = "Debian";
47         $kos["os"]["redhat"]["long"] = "RedHat Enterprise Linux";
48         $kos["os"]["ubuntu"]["long"] = "Ubuntu";
49         $kos["os"]["centos"]["long"] = "Community Enterprise OS";
50         
51         // Repo types per os
52         $kos["os"]["Fedora"]["repotype"] = "yum";
53         $kos["os"]["Debian"]["repotype"] = "apt";
54         $kos["os"]["RedHat"]["repotype"] = "yum";
55         $kos["os"]["Ubuntu"]["repotype"] = "apt";
56         $kos["os"]["CentOS"]["repotype"] = "yum";
57         
58         // architectyres
59         $kos["arch"]["intel32"] = "i386";
60         $kos["arch"]["amdcrazy"] = "i586";
61         $kos["arch"]["amd64"] = "x86_64";
62         $kos["arch"]["amd64_2"] = "amd64";
63         
64         
65         
66         return $kos;
67 }
68
69 ?>