Subversion Repositories SvarDOS

Rev

Rev 1268 | Rev 1513 | 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']);
15
?>
16
 
17
<form action="?" method="get">
18
<br>
19
<p>Category filter:&nbsp;
20
<input type="hidden" name="p" value="repo">
21
<select name="cat">
22
  <option value="">ALL</option>
23
<?php
24
  foreach ($cats as $c) {
25
    $sel = '';
26
    if ($c == $catfilter) $sel = ' selected';
27
    echo '  <option value="' . $c . "\"{$sel}>" . $c . "</option>\n";
28
  }
29
?>
30
</select>
31
<input type="submit" value="refresh">
32
</p>
33
</form>
34
 
35
 
36
<?php
37
 
1512 mateusz.vi 38
// hw filter?
39
$hw = array();
40
if (!empty($_GET['hw'])) {
41
  $hw = explode(' ', strtolower($_GET['hw']));
42
  foreach ($hw as $h) {
43
 
44
    // add all supported CPUs
45
    if ($h == '586') {
46
      $hw[] = '8086';
47
      $hw[] = '186';
48
      $hw[] = '286';
49
      $hw[] = '386';
50
      $hw[] = '486';
51
    }
52
    if ($h == '486') {
53
      $hw[] = '8086';
54
      $hw[] = '186';
55
      $hw[] = '286';
56
      $hw[] = '386';
57
    }
58
    if ($h == '386') {
59
      $hw[] = '8086';
60
      $hw[] = '186';
61
      $hw[] = '286';
62
    }
63
    if ($h == '286') {
64
      $hw[] = '8086';
65
      $hw[] = '186';
66
    }
67
    if ($h == '186') {
68
      $hw[] = '8086';
69
    }
70
 
71
    // add all supported graphic
72
    if ($h == 'svga') {
73
      $hw[] = 'vga';
74
      $hw[] = 'ega';
75
      $hw[] = 'cga';
76
      $hw[] = 'mda';
77
    }
78
    if ($h == 'vga') {
79
      $hw[] = 'ega';
80
      $hw[] = 'cga';
81
      $hw[] = 'mda';
82
    }
83
    if ($h == 'ega') {
84
      $hw[] = 'cga';
85
      $hw[] = 'mda';
86
    }
87
    if ($h == 'cga') {
88
      $hw[] = 'mda';
89
    }
90
 
91
  }
92
}
93
 
719 mateusz.vi 94
$db = json_decode(file_get_contents('../packages/_index.json'), true);
188 mateuszvis 95
 
910 mateusz.vi 96
echo "<table style=\"width: 100%;\">\n";
188 mateuszvis 97
 
98
echo "<thead><tr><th>PACKAGE</th><th>VERSION</th><th>DESCRIPTION</th></tr></thead>\n";
99
 
719 mateusz.vi 100
foreach ($db as $pkg => $meta) {
101
 
910 mateusz.vi 102
  if ((!empty($catfilter)) && (array_search($catfilter, $meta['cats']) === false)) continue;
103
 
719 mateusz.vi 104
  $desc = $meta['desc'];
1512 mateusz.vi 105
  check_next_ver:
719 mateusz.vi 106
  $pref = array_shift($meta['versions']); // get first version (that's the preferred one)
1512 mateusz.vi 107
  if (empty($pref)) continue; // no more versions
108
  $hwhint = '';
109
  if (!empty($pref['hwreq'])) {
110
    /* if hw filter present, make sure it fullfills package's requirements */
111
    foreach (explode(' ', $pref['hwreq']) as $req) {
112
      if (array_search($req, $hw, true) === false) goto check_next_ver;
113
    }
114
 
115
    $hwhint = ' title="' . htmlspecialchars(strtoupper($pref['hwreq'])) . '"';
116
  }
719 mateusz.vi 117
  $ver = $pref['ver'];
118
  $bsum = $pref['bsum'];
119
 
1512 mateusz.vi 120
  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 121
}
122
echo "</table>\n";
123
 
732 mateusz.vi 124
$errs = trim(file_get_contents('../packages/_buildidx.log'));
125
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>';
126
 
127
if ($_GET['showlogs'] == 1) {
128
  echo "<p style=\"font-size: 0.8em;\"><a name=\"logs\">DEBUG REPO BUILD LOGS</a>:<br>\n";
129
  if (empty($errs)) {
130
    echo "no buildidx errors to display\n";
131
  } else {
132
    echo nl2br(htmlentities($errs));
133
  }
134
  echo "</p>\n";
135
}
136
 
188 mateuszvis 137
?>