Subversion Repositories SvarDOS

Rev

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

Rev 1511 Rev 1522
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
  25 aug 2023: validation of the hwreq section in LSM files
13
  24 aug 2023: load hwreq data from LSM and store them in the json index + skip the '.svn' dir
14
  24 aug 2023: load hwreq data from LSM and store them in the json index + skip the '.svn' dir
14
  30 jun 2023: adapted for new CORE packages location (../packages-core)
15
  30 jun 2023: adapted for new CORE packages location (../packages-core)
15
  28 feb 2022: svarcom allowed to have a COMMAND.COM file without subdirectory
16
  28 feb 2022: svarcom allowed to have a COMMAND.COM file without subdirectory
16
  24 feb 2022: added hardcoded hack to translate version 'x.xx' to '0.44' (NESticle)
17
  24 feb 2022: added hardcoded hack to translate version 'x.xx' to '0.44' (NESticle)
17
  23 feb 2022: basic validation of source archives (not empty + matches an existing svp file)
18
  23 feb 2022: basic validation of source archives (not empty + matches an existing svp file)
Line 36... Line 37...
36
  10 jul 2013: changed unzip calls to 7za (to handle cases when appinfo is compressed with lzma)
37
  10 jul 2013: changed unzip calls to 7za (to handle cases when appinfo is compressed with lzma)
37
  04 feb 2013: added CRC32 support
38
  04 feb 2013: added CRC32 support
38
  22 sep 2012: forked 1st version from FDUPDATE builder
39
  22 sep 2012: forked 1st version from FDUPDATE builder
39
*/
40
*/
40
 
41
 
41
$PVER = "20230824";
42
$PVER = "20230825";
42
 
43
 
43
 
44
 
44
// computes the BSD sum of a file and returns it
45
// computes the BSD sum of a file and returns it
45
function file2bsum($fname) {
46
function file2bsum($fname) {
46
  $result = 0;
47
  $result = 0;
Line 423... Line 424...
423
 
424
 
424
  $meta = array();
425
  $meta = array();
425
  $meta['fname'] = $fname;
426
  $meta['fname'] = $fname;
426
  $meta['desc'] = $lsmarray['description'];
427
  $meta['desc'] = $lsmarray['description'];
427
  $meta['cats'] = array_unique($catlist);
428
  $meta['cats'] = array_unique($catlist);
-
 
429
 
-
 
430
  if (!empty($lsmarray['hwreq'])) {
428
  if (!empty($lsmarray['hwreq'])) $meta['hwreq'] = $lsmarray['hwreq'];
431
    $meta['hwreq'] = explode(' ', strtolower($lsmarray['hwreq']));
-
 
432
 
-
 
433
    // validate list of valid hwreq tokens
-
 
434
    $validtokens = array('8086', '186', '286', '386', '486', '586', 'fpu', 'mda', 'cga', 'ega', 'vga', 'mcga', 'svga');
-
 
435
    foreach (array_diff($meta['hwreq'], $validtokens) as $tok) echo "WARNING: {$fname} contains an LSM hwreq section with invalid token: {$tok}\n";
-
 
436
  }
429
 
437
 
430
  $pkgdb[$pkgnam][$lsmarray['version']] = $meta;
438
  $pkgdb[$pkgnam][$lsmarray['version']] = $meta;
431
}
439
}
432
 
440
 
433
 
441
 
Line 451... Line 459...
451
    $bsum = file2bsum(realpath($repodir . '/' . $fname));
459
    $bsum = file2bsum(realpath($repodir . '/' . $fname));
452
 
460
 
453
    $meta2 = array();
461
    $meta2 = array();
454
    $meta2['ver'] = strval($ver);
462
    $meta2['ver'] = strval($ver);
455
    $meta2['bsum'] = $bsum;
463
    $meta2['bsum'] = $bsum;
456
    if (!empty($meta['hwreq'])) $meta2['hwreq'] = strtolower($meta['hwreq']);
464
    if (!empty($meta['hwreq'])) $meta2['hwreq'] = $meta['hwreq'];
457
 
465
 
458
    if (empty($db[$pkg]['desc'])) $db[$pkg]['desc'] = $desc;
466
    if (empty($db[$pkg]['desc'])) $db[$pkg]['desc'] = $desc;
459
    if (empty($db[$pkg]['cats'])) {
467
    if (empty($db[$pkg]['cats'])) {
460
      $db[$pkg]['cats'] = $meta['cats'];
468
      $db[$pkg]['cats'] = $meta['cats'];
461
      $cats = array_unique(array_merge($cats, $meta['cats']));
469
      $cats = array_unique(array_merge($cats, $meta['cats']));