Subversion Repositories SvarDOS

Rev

Rev 1803 | 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
 
1701 mateusz.vi 6
<p>You may also download a CD ISO image that contains the latest version of each package: <a href="repo/sv-repo.iso">SV-REPO.ISO</a> (<?php echo intval(filesize('repo/sv-repo.iso') / 1024 / 1024); ?>M, <a href="repo/sv-repo.iso.md5">md5</a>)</p>
1699 mateusz.vi 7
 
1804 mateusz.vi 8
<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%20Packages&amp;path=%2F&amp;isdir=1">SvarDOS Packages RSS feed</a>.</p>
896 bttr 9
 
188 mateuszvis 10
<?php
910 mateusz.vi 11
  // load the category list
12
  $cats = json_decode(file_get_contents('../packages/_cats.json'), true);
13
  sort($cats);
188 mateuszvis 14
 
910 mateusz.vi 15
  $catfilter = '';
16
  if (!empty($_GET['cat'])) $catfilter = strtolower($_GET['cat']);
1513 mateusz.vi 17
 
18
  // hw filter?
19
  $hw = array();
20
  if (!empty($_GET['hwcpu'])) $hw[] = strtolower($_GET['hwcpu']);
21
  if (!empty($_GET['hwvid'])) $hw[] = strtolower($_GET['hwvid']);
22
  if ((!empty($_GET['fpu'])) && ($_GET['fpu'] == 'yes')) $hw[] = 'fpu';
23
 
1803 mateusz.vi 24
  // view mode (0=simple 1=full)
25
  $view = 0;
26
  if (!empty($_GET['view'])) $view = intval($_GET['view']);
910 mateusz.vi 27
?>
28
 
29
<form action="?" method="get">
30
<br>
1513 mateusz.vi 31
<p>Filters:<br>
910 mateusz.vi 32
<input type="hidden" name="p" value="repo">
1513 mateusz.vi 33
 
34
Target hardware:
35
 
36
<select name="hwcpu">
37
 
38
<?php
39
  // build form with list of CPUs + preselect the current CPU (if any)
1520 mateusz.vi 40
  $cpus = array('586', '486', '386', '286', '186', '8086');
1513 mateusz.vi 41
  foreach ($cpus as $cpu) {
42
    $sel = '';
43
    if (array_search($cpu, $hw) !== false) $sel = ' selected';
44
    echo "<option{$sel}>{$cpu}</option>\n";
45
  }
46
?>
47
</select>
48
 
49
<select name="hwfpu">
50
<?php
51
if (empty($_GET['hwfpu'])) {
52
  echo "<option selected value=\"\">no FPU</option>\n";
53
  echo "<option>FPU</option>\n";
54
} else {
55
  echo "<option value=\"\">no FPU</option>\n";
56
  echo "<option selected>FPU</option>\n";
57
}
58
?>
59
</select>
60
 
61
<select name="hwvid">
62
<?php
1520 mateusz.vi 63
  // build form with list of graphic cards + preselect the current card (if any)
64
  $vids = array('SVGA', 'VGA', 'MCGA', 'EGA', 'CGA', 'MDA');
1513 mateusz.vi 65
  foreach ($vids as $v) {
66
    $sel = '';
67
    if (array_search(strtolower($v), $hw) !== false) $sel = ' selected';
68
    echo "<option{$sel}>{$v}</option>\n";
69
  }
70
?>
71
</select>
72
 
73
<br>
74
 
75
Category:
910 mateusz.vi 76
<select name="cat">
77
  <option value="">ALL</option>
78
<?php
79
  foreach ($cats as $c) {
80
    $sel = '';
81
    if ($c == $catfilter) $sel = ' selected';
82
    echo '  <option value="' . $c . "\"{$sel}>" . $c . "</option>\n";
83
  }
84
?>
85
</select>
1513 mateusz.vi 86
 
87
<input type="submit" value="apply">
910 mateusz.vi 88
</p>
89
</form>
90
 
91
 
92
<?php
93
 
1513 mateusz.vi 94
// add all supported subsets of hardware (eg. VGA supports MDA, EGA and CGA modes)
95
foreach ($hw as $h) {
1512 mateusz.vi 96
 
1513 mateusz.vi 97
  // add all supported CPUs
98
  if ($h == '586') {
99
    $hw[] = '8086';
100
    $hw[] = '186';
101
    $hw[] = '286';
102
    $hw[] = '386';
103
    $hw[] = '486';
104
  }
105
  if ($h == '486') {
106
    $hw[] = '8086';
107
    $hw[] = '186';
108
    $hw[] = '286';
109
    $hw[] = '386';
110
  }
111
  if ($h == '386') {
112
    $hw[] = '8086';
113
    $hw[] = '186';
114
    $hw[] = '286';
115
  }
116
  if ($h == '286') {
117
    $hw[] = '8086';
118
    $hw[] = '186';
119
  }
120
  if ($h == '186') {
121
    $hw[] = '8086';
122
  }
1512 mateusz.vi 123
 
1513 mateusz.vi 124
  // add all supported graphic
125
  if ($h == 'svga') {
126
    $hw[] = 'vga';
127
    $hw[] = 'ega';
128
    $hw[] = 'cga';
129
    $hw[] = 'mda';
130
  }
131
  if ($h == 'vga') {
132
    $hw[] = 'mcga';
133
    $hw[] = 'ega';
134
    $hw[] = 'cga';
135
    $hw[] = 'mda';
136
  }
137
  if ($h == 'mcga') {
138
    $hw[] = 'ega';
139
    $hw[] = 'cga';
140
    $hw[] = 'mda';
141
  }
142
  if ($h == 'ega') {
143
    $hw[] = 'cga';
144
    $hw[] = 'mda';
145
  }
146
  if ($h == 'cga') {
147
    $hw[] = 'mda';
148
  }
1512 mateusz.vi 149
}
150
 
1513 mateusz.vi 151
 
719 mateusz.vi 152
$db = json_decode(file_get_contents('../packages/_index.json'), true);
188 mateuszvis 153
 
910 mateusz.vi 154
echo "<table style=\"width: 100%;\">\n";
188 mateuszvis 155
 
156
echo "<thead><tr><th>PACKAGE</th><th>VERSION</th><th>DESCRIPTION</th></tr></thead>\n";
157
 
719 mateusz.vi 158
foreach ($db as $pkg => $meta) {
159
 
910 mateusz.vi 160
  if ((!empty($catfilter)) && (array_search($catfilter, $meta['cats']) === false)) continue;
161
 
1803 mateusz.vi 162
  $desc = htmlspecialchars($meta['desc']);
1512 mateusz.vi 163
  check_next_ver:
719 mateusz.vi 164
  $pref = array_shift($meta['versions']); // get first version (that's the preferred one)
1512 mateusz.vi 165
  if (empty($pref)) continue; // no more versions
166
  $hwhint = '';
1520 mateusz.vi 167
  if (!empty($pref['hwreq'])) {
1523 mateusz.vi 168
    $hwhint = ' title="' . htmlspecialchars(strtoupper(implode(', ', $pref['hwreq']))) . '"';
1520 mateusz.vi 169
 
1512 mateusz.vi 170
    /* if hw filter present, make sure it fullfills package's requirements */
1520 mateusz.vi 171
    if (!empty($hw)) {
1523 mateusz.vi 172
      foreach ($pref['hwreq'] as $req) {
1520 mateusz.vi 173
        if (array_search($req, $hw, true) === false) goto check_next_ver;
174
      }
1512 mateusz.vi 175
    }
176
  }
719 mateusz.vi 177
  $ver = $pref['ver'];
178
  $bsum = $pref['bsum'];
179
 
1803 mateusz.vi 180
  if ($view === 0) {
181
    echo "<tr><td><a{$hwhint} href=\"repo/?a=pull&amp;p={$pkg}\">{$pkg}</a></td><td>{$ver}</td><td>{$desc}</td></tr>\n";
182
  } else {
183
    $link = '';
184
    if (!empty($meta['url'])) $link = '<span class="extrainfo"><br><a href="' . htmlspecialchars($meta['url']) . '">' . htmlspecialchars($meta['url']) . '</a></span>';
185
    echo "<tr><td><a{$hwhint} href=\"repo/?a=pull&amp;p={$pkg}\">{$pkg}</a><span class=\"extrainfo\"><br>";
1804 mateusz.vi 186
    foreach ($meta['cats'] as $c) {
187
      echo '<a href="?p=repo&amp;cat=' . urlencode($c) . '&amp;view=1">' . htmlspecialchars($c) . '</a>';
188
    }
1803 mateusz.vi 189
    echo "</span></td><td>{$ver}</td><td>{$desc}{$link}</td></tr>\n";
190
  }
188 mateuszvis 191
}
192
echo "</table>\n";
193
 
732 mateusz.vi 194
$errs = trim(file_get_contents('../packages/_buildidx.log'));
195
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>';
196
 
197
if ($_GET['showlogs'] == 1) {
198
  echo "<p style=\"font-size: 0.8em;\"><a name=\"logs\">DEBUG REPO BUILD LOGS</a>:<br>\n";
199
  if (empty($errs)) {
200
    echo "no buildidx errors to display\n";
201
  } else {
202
    echo nl2br(htmlentities($errs));
203
  }
204
  echo "</p>\n";
205
}
206
 
188 mateuszvis 207
?>