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 |
24 aug 2023: load hwreq data from LSM and store them in the json index + skip the '.svn' dir
|
13 |
30 jun 2023: adapted for new CORE packages location (../packages-core)
|
14 |
30 jun 2023: adapted for new CORE packages location (../packages-core)
|
14 |
28 feb 2022: svarcom allowed to have a COMMAND.COM file without subdirectory
|
15 |
28 feb 2022: svarcom allowed to have a COMMAND.COM file without subdirectory
|
15 |
24 feb 2022: added hardcoded hack to translate version 'x.xx' to '0.44' (NESticle)
|
16 |
24 feb 2022: added hardcoded hack to translate version 'x.xx' to '0.44' (NESticle)
|
16 |
23 feb 2022: basic validation of source archives (not empty + matches an existing svp file)
|
17 |
23 feb 2022: basic validation of source archives (not empty + matches an existing svp file)
|
17 |
21 feb 2022: buildidx collects categories looking at the dir layout of each package + improved version string parsing (replaced version_compare call by dos_version_compare)
|
18 |
21 feb 2022: buildidx collects categories looking at the dir layout of each package + improved version string parsing (replaced version_compare call by dos_version_compare)
|
Line 35... |
Line 36... |
35 |
10 jul 2013: changed unzip calls to 7za (to handle cases when appinfo is compressed with lzma)
|
36 |
10 jul 2013: changed unzip calls to 7za (to handle cases when appinfo is compressed with lzma)
|
36 |
04 feb 2013: added CRC32 support
|
37 |
04 feb 2013: added CRC32 support
|
37 |
22 sep 2012: forked 1st version from FDUPDATE builder
|
38 |
22 sep 2012: forked 1st version from FDUPDATE builder
|
38 |
*/
|
39 |
*/
|
39 |
|
40 |
|
40 |
$PVER = "20230630";
|
41 |
$PVER = "20230824";
|
41 |
|
42 |
|
42 |
|
43 |
|
43 |
// computes the BSD sum of a file and returns it
|
44 |
// computes the BSD sum of a file and returns it
|
44 |
function file2bsum($fname) {
|
45 |
function file2bsum($fname) {
|
45 |
$result = 0;
|
46 |
$result = 0;
|
Line 304... |
Line 305... |
304 |
if (!file_exists($repodir . '/' . $svpfname)) echo "ERROR: orphaned source archive '{$fname}' (no matching svp file, expecting a package named '{$svpfname}')\n";
|
305 |
if (!file_exists($repodir . '/' . $svpfname)) echo "ERROR: orphaned source archive '{$fname}' (no matching svp file, expecting a package named '{$svpfname}')\n";
|
305 |
// that is for zip files
|
306 |
// that is for zip files
|
306 |
continue;
|
307 |
continue;
|
307 |
}
|
308 |
}
|
308 |
|
309 |
|
- |
|
310 |
// silently skip the hidden .svn directory
|
- |
|
311 |
if ($fname === '.svn') continue;
|
- |
|
312 |
|
309 |
// skip (and warn about) non-svp
|
313 |
// skip (and warn about) non-svp
|
310 |
if (!preg_match('/\.svp$/', $fname)) {
|
314 |
if (!preg_match('/\.svp$/', $fname)) {
|
311 |
$okfiles = array('.', '..', '_cats.json', '_index.json', '_buildidx.log');
|
315 |
$okfiles = array('.', '..', '_cats.json', '_index.json', '_buildidx.log');
|
312 |
if (array_search($fname, $okfiles) !== false) continue;
|
316 |
if (array_search($fname, $okfiles) !== false) continue;
|
313 |
echo "WARNING: wild file '{$fname} (this is either an useless file that should be removed, or a misnamed package or source archive)'\n";
|
317 |
echo "WARNING: wild file '{$fname}' (this is either an useless file that should be removed, or a misnamed package or source archive)'\n";
|
314 |
continue;
|
318 |
continue;
|
315 |
}
|
319 |
}
|
316 |
|
320 |
|
317 |
if (!preg_match('/^[a-zA-Z0-9+. _-]*\.svp$/', $fname)) {
|
321 |
if (!preg_match('/^[a-zA-Z0-9+. _-]*\.svp$/', $fname)) {
|
318 |
echo "ERROR: {$fname} has a very weird name\n";
|
322 |
echo "ERROR: {$fname} has a very weird name\n";
|
Line 418... |
Line 422... |
418 |
if (vertoarr($lsmarray['version']) === false) echo "WARNING: {$fname} parsing of version string failed ('{$lsmarray['version']}')\n";
|
422 |
if (vertoarr($lsmarray['version']) === false) echo "WARNING: {$fname} parsing of version string failed ('{$lsmarray['version']}')\n";
|
419 |
|
423 |
|
420 |
$meta['fname'] = $fname;
|
424 |
$meta['fname'] = $fname;
|
421 |
$meta['desc'] = $lsmarray['description'];
|
425 |
$meta['desc'] = $lsmarray['description'];
|
422 |
$meta['cats'] = array_unique($catlist);
|
426 |
$meta['cats'] = array_unique($catlist);
|
- |
|
427 |
if (!empty($lsmarray['hwreq'])) $meta['hwreq'] = $lsmarray['hwreq'];
|
423 |
|
428 |
|
424 |
$pkgdb[$pkgnam][$lsmarray['version']] = $meta;
|
429 |
$pkgdb[$pkgnam][$lsmarray['version']] = $meta;
|
425 |
}
|
430 |
}
|
426 |
|
431 |
|
427 |
|
432 |
|