Subversion Repositories SvarDOS

Rev

Rev 737 | Rev 739 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 737 Rev 738
Line 124... Line 124...
124
$repodir = $_SERVER['argv'][1];
124
$repodir = $_SERVER['argv'][1];
125
 
125
 
126
$pkgfiles = scandir($repodir);
126
$pkgfiles = scandir($repodir);
127
$pkgcount = 0;
127
$pkgcount = 0;
128
 
128
 
-
 
129
 
-
 
130
// load the list of CORE packages
-
 
131
 
-
 
132
$core_packages_list = explode(' ', 'amb attrib chkdsk choice command cpidos debug deltree devload diskcopy display dosfsck edit fc fdapm fdisk find format help himemx kernel keyb keyb_lay label localcfg mem mode more move pkg pkgnet shsucdx sort tree');
-
 
133
 
-
 
134
 
129
// do a list of all svp packages with their available versions and descriptions
135
// do a list of all svp packages with their available versions and descriptions
130
 
136
 
131
$pkgdb = array();
137
$pkgdb = array();
132
foreach ($pkgfiles as $fname) {
138
foreach ($pkgfiles as $fname) {
133
  if (!preg_match('/.svp$/i', $fname)) continue; // skip non-svp files
139
  if (!preg_match('/.svp$/i', $fname)) continue; // skip non-svp files
Line 154... Line 160...
154
    echo "ERROR: lsm file in {$fname} does not contain a description\n";
160
    echo "ERROR: lsm file in {$fname} does not contain a description\n";
155
    continue;
161
    continue;
156
  }
162
  }
157
 
163
 
158
  // validate the files present in the archive
164
  // validate the files present in the archive
159
  $core_packages_list = explode(' ', 'amb attrib chkdsk choice command cpidos debug deltree devload diskcopy display dosfsck edit fc fdapm fdisk find format help himemx kernel keyb keyb_lay label localcfg mem mode more move pkg pkgnet shsucdx sort tree');
-
 
160
  $listoffiles = read_list_of_files_in_zip($pkgfullpath);
165
  $listoffiles = read_list_of_files_in_zip($pkgfullpath);
161
  foreach ($listoffiles as $f) {
166
  foreach ($listoffiles as $f) {
162
    $f = strtolower($f);
167
    $f = strtolower($f);
163
    // LSM file is ok
168
    // LSM file is ok
164
    if ($f === "appinfo/{$pkgnam}.lsm") continue;
169
    if ($f === "appinfo/{$pkgnam}.lsm") continue;
165
    if ($f === "appinfo/") continue;
170
    if ($f === "appinfo/") continue;
166
    // CORE packages are premium citizens and can do a little more
171
    // CORE packages are premium citizens and can do a little more
167
    if (array_search($pkgnam, $core_packages_list)) {
172
    if (array_search($pkgnam, $core_packages_list) !== false) {
168
      if (str_head_is($f, 'bin/')) continue;
173
      if (str_head_is($f, 'bin/')) continue;
169
    }
174
    }
170
    // well-known dirs are okay
175
    // well-known dirs are okay
171
    if (str_head_is($f, "doc/{$pkgnam}/")) continue;
176
    if (str_head_is($f, "doc/{$pkgnam}/")) continue;
172
    if ($f === 'doc/') continue;
177
    if ($f === 'doc/') continue;