Subversion Repositories SvarDOS

Rev

Rev 1512 | Rev 1520 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
188 mateuszvis 1
<h1>SvarDOS repository</h1>
285 mateuszvis 2
<p class="copyr">"the world of packages"</p>
188 mateuszvis 3
 
4
<p>This page lists all packages that are available in the SvarDOS repository. These packages can be downloaded from within SvarDOS using the pkgnet tool, or you can download them from here.</p>
5
 
1268 mateusz.vi 6
<!-- <p>If you wish to receive notifications about new or updated packages, you may subscribe to the <a href="http://svn.svardos.org/rss.php?repname=SvarDOS&path=%2Fpackages%2F">SvarDOS Packages RSS feed</a>.</p>-->
896 bttr 7
 
188 mateuszvis 8
<?php
910 mateusz.vi 9
  // load the category list
10
  $cats = json_decode(file_get_contents('../packages/_cats.json'), true);
11
  sort($cats);
188 mateuszvis 12
 
910 mateusz.vi 13
  $catfilter = '';
14
  if (!empty($_GET['cat'])) $catfilter = strtolower($_GET['cat']);
1513 mateusz.vi 15
 
16
  // hw filter?
17
  $hw = array();
18
  if (!empty($_GET['hwcpu'])) $hw[] = strtolower($_GET['hwcpu']);
19
  if (!empty($_GET['hwvid'])) $hw[] = strtolower($_GET['hwvid']);
20
  if ((!empty($_GET['fpu'])) && ($_GET['fpu'] == 'yes')) $hw[] = 'fpu';
21
 
910 mateusz.vi 22
?>
23
 
24
<form action="?" method="get">
25
<br>
1513 mateusz.vi 26
<p>Filters:<br>
910 mateusz.vi 27
<input type="hidden" name="p" value="repo">
1513 mateusz.vi 28
 
29
Target hardware:
30
 
31
<select name="hwcpu">
32
 
33
<?php
34
  // build form with list of CPUs + preselect the current CPU (if any)
35
  $cpus = array('586', '486', '186', '8086');
36
  foreach ($cpus as $cpu) {
37
    $sel = '';
38
    if (array_search($cpu, $hw) !== false) $sel = ' selected';
39
    echo "<option{$sel}>{$cpu}</option>\n";
40
  }
41
?>
42
</select>
43
 
44
<select name="hwfpu">
45
<?php
46
if (empty($_GET['hwfpu'])) {
47
  echo "<option selected value=\"\">no FPU</option>\n";
48
  echo "<option>FPU</option>\n";
49
} else {
50
  echo "<option value=\"\">no FPU</option>\n";
51
  echo "<option selected>FPU</option>\n";
52
}
53
?>
54
</select>
55
 
56
<select name="hwvid">
57
<?php
58
  // build form with list of CPUs + preselect the current CPU (if any)
59
  $vids = array('SVGA', 'VGA', 'MCGA', 'EGA', 'CGA', 'MDA', 'HGC');
60
  foreach ($vids as $v) {
61
    $sel = '';
62
    if (array_search(strtolower($v), $hw) !== false) $sel = ' selected';
63
    echo "<option{$sel}>{$v}</option>\n";
64
  }
65
?>
66
</select>
67
 
68
<br>
69
 
70
Category:
910 mateusz.vi 71
<select name="cat">
72
  <option value="">ALL</option>
73
<?php
74
  foreach ($cats as $c) {
75
    $sel = '';
76
    if ($c == $catfilter) $sel = ' selected';
77
    echo '  <option value="' . $c . "\"{$sel}>" . $c . "</option>\n";
78
  }
79
?>
80
</select>
1513 mateusz.vi 81
 
82
<input type="submit" value="apply">
910 mateusz.vi 83
</p>
84
</form>
85
 
86
 
87
<?php
88
 
1513 mateusz.vi 89
// add all supported subsets of hardware (eg. VGA supports MDA, EGA and CGA modes)
90
foreach ($hw as $h) {
1512 mateusz.vi 91
 
1513 mateusz.vi 92
  // add all supported CPUs
93
  if ($h == '586') {
94
    $hw[] = '8086';
95
    $hw[] = '186';
96
    $hw[] = '286';
97
    $hw[] = '386';
98
    $hw[] = '486';
99
  }
100
  if ($h == '486') {
101
    $hw[] = '8086';
102
    $hw[] = '186';
103
    $hw[] = '286';
104
    $hw[] = '386';
105
  }
106
  if ($h == '386') {
107
    $hw[] = '8086';
108
    $hw[] = '186';
109
    $hw[] = '286';
110
  }
111
  if ($h == '286') {
112
    $hw[] = '8086';
113
    $hw[] = '186';
114
  }
115
  if ($h == '186') {
116
    $hw[] = '8086';
117
  }
1512 mateusz.vi 118
 
1513 mateusz.vi 119
  // add all supported graphic
120
  if ($h == 'svga') {
121
    $hw[] = 'vga';
122
    $hw[] = 'ega';
123
    $hw[] = 'cga';
124
    $hw[] = 'mda';
125
  }
126
  if ($h == 'vga') {
127
    $hw[] = 'mcga';
128
    $hw[] = 'ega';
129
    $hw[] = 'cga';
130
    $hw[] = 'mda';
131
  }
132
  if ($h == 'mcga') {
133
    $hw[] = 'ega';
134
    $hw[] = 'cga';
135
    $hw[] = 'mda';
136
  }
137
  if ($h == 'ega') {
138
    $hw[] = 'cga';
139
    $hw[] = 'mda';
140
  }
141
  if ($h == 'cga') {
142
    $hw[] = 'mda';
143
  }
144
  if ($h == 'hgc') {
145
    $hw[] = 'mda';
146
  }
1512 mateusz.vi 147
 
148
}
149
 
1513 mateusz.vi 150
 
719 mateusz.vi 151
$db = json_decode(file_get_contents('../packages/_index.json'), true);
188 mateuszvis 152
 
910 mateusz.vi 153
echo "<table style=\"width: 100%;\">\n";
188 mateuszvis 154
 
155
echo "<thead><tr><th>PACKAGE</th><th>VERSION</th><th>DESCRIPTION</th></tr></thead>\n";
156
 
719 mateusz.vi 157
foreach ($db as $pkg => $meta) {
158
 
910 mateusz.vi 159
  if ((!empty($catfilter)) && (array_search($catfilter, $meta['cats']) === false)) continue;
160
 
719 mateusz.vi 161
  $desc = $meta['desc'];
1512 mateusz.vi 162
  check_next_ver:
719 mateusz.vi 163
  $pref = array_shift($meta['versions']); // get first version (that's the preferred one)
1512 mateusz.vi 164
  if (empty($pref)) continue; // no more versions
165
  $hwhint = '';
1513 mateusz.vi 166
  if (!empty($pref['hwreq']) && (!empty($hw))) {
1512 mateusz.vi 167
    /* if hw filter present, make sure it fullfills package's requirements */
168
    foreach (explode(' ', $pref['hwreq']) as $req) {
169
      if (array_search($req, $hw, true) === false) goto check_next_ver;
170
    }
171
 
172
    $hwhint = ' title="' . htmlspecialchars(strtoupper($pref['hwreq'])) . '"';
173
  }
719 mateusz.vi 174
  $ver = $pref['ver'];
175
  $bsum = $pref['bsum'];
176
 
1512 mateusz.vi 177
  echo "<tr><td><a{$hwhint} href=\"repo/?a=pull&amp;p={$pkg}\">{$pkg}</a></td><td>{$ver}</td><td>{$desc}</td></tr>\n";
188 mateuszvis 178
}
179
echo "</table>\n";
180
 
732 mateusz.vi 181
$errs = trim(file_get_contents('../packages/_buildidx.log'));
182
if (!empty($errs)) echo '<p style="color: #f00; font-weigth: bold;">Note to SvarDOS packagers: inconsistencies have been detected in the repository, please <a href="?p=repo&amp;showlogs=1#logs">review them</a>.</p>';
183
 
184
if ($_GET['showlogs'] == 1) {
185
  echo "<p style=\"font-size: 0.8em;\"><a name=\"logs\">DEBUG REPO BUILD LOGS</a>:<br>\n";
186
  if (empty($errs)) {
187
    echo "no buildidx errors to display\n";
188
  } else {
189
    echo nl2br(htmlentities($errs));
190
  }
191
  echo "</p>\n";
192
}
193
 
188 mateuszvis 194
?>