Subversion Repositories SvarDOS

Rev

Rev 1513 | Rev 1523 | 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)
1520 mateusz.vi 35
  $cpus = array('586', '486', '386', '286', '186', '8086');
1513 mateusz.vi 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
1520 mateusz.vi 58
  // build form with list of graphic cards + preselect the current card (if any)
59
  $vids = array('SVGA', 'VGA', 'MCGA', 'EGA', 'CGA', 'MDA');
1513 mateusz.vi 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
  }
1512 mateusz.vi 144
}
145
 
1513 mateusz.vi 146
 
719 mateusz.vi 147
$db = json_decode(file_get_contents('../packages/_index.json'), true);
188 mateuszvis 148
 
910 mateusz.vi 149
echo "<table style=\"width: 100%;\">\n";
188 mateuszvis 150
 
151
echo "<thead><tr><th>PACKAGE</th><th>VERSION</th><th>DESCRIPTION</th></tr></thead>\n";
152
 
719 mateusz.vi 153
foreach ($db as $pkg => $meta) {
154
 
910 mateusz.vi 155
  if ((!empty($catfilter)) && (array_search($catfilter, $meta['cats']) === false)) continue;
156
 
719 mateusz.vi 157
  $desc = $meta['desc'];
1512 mateusz.vi 158
  check_next_ver:
719 mateusz.vi 159
  $pref = array_shift($meta['versions']); // get first version (that's the preferred one)
1512 mateusz.vi 160
  if (empty($pref)) continue; // no more versions
161
  $hwhint = '';
1520 mateusz.vi 162
  if (!empty($pref['hwreq'])) {
163
    $hwhint = ' title="' . htmlspecialchars(strtoupper($pref['hwreq'])) . '"';
164
 
1512 mateusz.vi 165
    /* if hw filter present, make sure it fullfills package's requirements */
1520 mateusz.vi 166
    if (!empty($hw)) {
167
      foreach (explode(' ', $pref['hwreq']) as $req) {
168
        if (array_search($req, $hw, true) === false) goto check_next_ver;
169
      }
1512 mateusz.vi 170
    }
171
  }
719 mateusz.vi 172
  $ver = $pref['ver'];
173
  $bsum = $pref['bsum'];
174
 
1512 mateusz.vi 175
  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 176
}
177
echo "</table>\n";
178
 
732 mateusz.vi 179
$errs = trim(file_get_contents('../packages/_buildidx.log'));
180
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>';
181
 
182
if ($_GET['showlogs'] == 1) {
183
  echo "<p style=\"font-size: 0.8em;\"><a name=\"logs\">DEBUG REPO BUILD LOGS</a>:<br>\n";
184
  if (empty($errs)) {
185
    echo "no buildidx errors to display\n";
186
  } else {
187
    echo nl2br(htmlentities($errs));
188
  }
189
  echo "</p>\n";
190
}
191
 
188 mateuszvis 192
?>