Subversion Repositories SvarDOS

Rev

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

Rev 734 Rev 736
Line 8... Line 8...
8
  files. buildidx will generate the index file and save it into the package
8
  files. buildidx will generate the index file and save it into the package
9
  repository.
9
  repository.
10
 
10
 
11
  requires php-zip
11
  requires php-zip
12
 
12
 
13
  16 feb 2022: added warning about overlong version strings
13
  16 feb 2022: added warning about overlong version strings and wild files location
14
  15 feb 2022: index is generated as json, contains all filenames and alt versions
14
  15 feb 2022: index is generated as json, contains all filenames and alt versions
15
  14 feb 2022: packages are expected to have the *.svp extension
15
  14 feb 2022: packages are expected to have the *.svp extension
16
  12 feb 2022: skip source packages from being processed (*.src.zip)
16
  12 feb 2022: skip source packages from being processed (*.src.zip)
17
  20 jan 2022: rewritten the code from ANSI C to PHP for easier maintenance
17
  20 jan 2022: rewritten the code from ANSI C to PHP for easier maintenance
18
  13 feb 2021: 'title' LSM field is no longer looked after
18
  13 feb 2021: 'title' LSM field is no longer looked after
Line 154... Line 154...
154
    echo "ERROR: lsm file in {$fname} does not contain a description\n";
154
    echo "ERROR: lsm file in {$fname} does not contain a description\n";
155
    continue;
155
    continue;
156
  }
156
  }
157
 
157
 
158
  // validate the files present in the archive
158
  // 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');
159
  $listoffiles = read_list_of_files_in_zip($pkgfullpath);
160
  $listoffiles = read_list_of_files_in_zip($pkgfullpath);
160
  foreach ($listoffiles as $f) {
161
  foreach ($listoffiles as $f) {
161
    $f = strtolower($f);
162
    $f = strtolower($f);
162
    // LSM file is ok
163
    // LSM file is ok
163
    if ($f === "appinfo/{$pkgnam}.lsm") continue;
164
    if ($f === "appinfo/{$pkgnam}.lsm") continue;
164
    if ($f === "appinfo/") continue;
165
    if ($f === "appinfo/") continue;
-
 
166
    // CORE packages are premium citizens and can do a little more
-
 
167
    if (array_search($pkgnam, $core_packages_list)) {
-
 
168
      if (str_head_is($f, 'bin/')) continue;
-
 
169
    }
165
    // well-known dirs are okay
170
    // well-known dirs are okay
166
    if (str_head_is($f, 'bin/')) continue;
-
 
167
    if (str_head_is($f, "doc/{$pkgnam}/")) continue;
171
    if (str_head_is($f, "doc/{$pkgnam}/")) continue;
168
    if ($f === 'doc/') continue;
172
    if ($f === 'doc/') continue;
169
    if (str_head_is($f, "nls/{$pkgnam}.")) continue;
173
    if (str_head_is($f, "nls/{$pkgnam}.")) continue;
170
    if ($f === 'nls/') continue;
174
    if ($f === 'nls/') continue;
171
    if (str_head_is($f, "progs/{$pkgnam}/")) continue;
175
    if (str_head_is($f, "progs/{$pkgnam}/")) continue;