-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathmachine-list.php
66 lines (59 loc) · 1.33 KB
/
machine-list.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<?
/* Narcissus - online image builder for the angstrom distribution
* Koen Kooi (c) 2008 - 2010 - all rights reserved
*/
function machine_dropdown()
{
$machine = array();
if ($handle = opendir ('./conf/'))
{
/* This is the correct way to loop over the directory. */
while (false !== ($file = readdir ($handle)))
{
if ($file != "." && $file != ".."
&& file_exists ("./conf/$file/arch.conf"))
{
$machine[] = $file;
}
}
closedir ($handle);
}
sort ($machine);
foreach ($machine as $value)
{
print ("\t\t\t\t<option value=\"$value\">$value</option>\n");
}
}
function config_dropdown()
{
$configs = array();
foreach ($machine as $machine_value)
{
if ($handle = opendir ('./conf/$machine_value'))
{
while (false !== ($file = readdir ($handle)))
{
if ($file != "." && $file != ".."
&& file_exists ("./conf/$machine_value/configs/$file/"))
{
$configs[$machine_value][] = $file;
}
}
closedir ($handle);
}
sort ($configs);
foreach ($configs as $value)
{
print ("\t<option value=\"$value\">$value</option>\n");
}
}
}
$repourl = "http://www.angstrom-distribution.org/repo/?pkgname";
?>
<div id='machinelist'>
Select the machine you want to build your rootfs image for:<br/><br/>
<select name="machine">
<? machine_dropdown(); ?>
</select >
<br/>
</div>