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 |
23 feb 2022: basic validation of source archives (not empty + matches an existing svp file)
|
13 |
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)
|
14 |
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)
|
14 |
17 feb 2022: checking for non-8+3 filenames in packages and duplicates + devload no longer part of CORE
|
15 |
17 feb 2022: checking for non-8+3 filenames in packages and duplicates + devload no longer part of CORE
|
15 |
16 feb 2022: added warning about overlong version strings and wild files location
|
16 |
16 feb 2022: added warning about overlong version strings and wild files location
|
16 |
15 feb 2022: index is generated as json, contains all filenames and alt versions
|
17 |
15 feb 2022: index is generated as json, contains all filenames and alt versions
|
17 |
14 feb 2022: packages are expected to have the *.svp extension
|
18 |
14 feb 2022: packages are expected to have the *.svp extension
|
Line 31... |
Line 32... |
31 |
10 jul 2013: changed unzip calls to 7za (to handle cases when appinfo is compressed with lzma)
|
32 |
10 jul 2013: changed unzip calls to 7za (to handle cases when appinfo is compressed with lzma)
|
32 |
04 feb 2013: added CRC32 support
|
33 |
04 feb 2013: added CRC32 support
|
33 |
22 sep 2012: forked 1st version from FDUPDATE builder
|
34 |
22 sep 2012: forked 1st version from FDUPDATE builder
|
34 |
*/
|
35 |
*/
|
35 |
|
36 |
|
36 |
$PVER = "20220222";
|
37 |
$PVER = "20220223";
|
37 |
|
38 |
|
38 |
|
39 |
|
39 |
// computes the BSD sum of a file and returns it
|
40 |
// computes the BSD sum of a file and returns it
|
40 |
function file2bsum($fname) {
|
41 |
function file2bsum($fname) {
|
41 |
$result = 0;
|
42 |
$result = 0;
|
Line 284... |
Line 285... |
284 |
|
285 |
|
285 |
// do a list of all svp packages with their available versions and descriptions
|
286 |
// do a list of all svp packages with their available versions and descriptions
|
286 |
|
287 |
|
287 |
$pkgdb = array();
|
288 |
$pkgdb = array();
|
288 |
foreach ($pkgfiles as $fname) {
|
289 |
foreach ($pkgfiles as $fname) {
|
- |
|
290 |
|
- |
|
291 |
// zip files (ie. source archives)
|
- |
|
292 |
if (preg_match('/\.zip$/', $fname)) {
|
- |
|
293 |
// the zip archive should contain at least one file
|
- |
|
294 |
if (count(read_list_of_files_in_zip($repodir . '/' . $fname)) < 1) echo "WARNING: source archive {$fname} contains no files (either empty or corrupted)\n";
|
- |
|
295 |
// check that the file relates to an existing svp package
|
- |
|
296 |
$svpfname = preg_replace('/zip$/', 'svp', $fname);
|
- |
|
297 |
if (!file_exists($repodir . '/' . $svpfname)) echo "ERROR: orphaned source archive '{$fname}' (no matching svp file, expecting a package named '{$svpfname}')\n";
|
- |
|
298 |
// that is for zip files
|
- |
|
299 |
continue;
|
- |
|
300 |
}
|
- |
|
301 |
|
- |
|
302 |
// skip (and warn about) non-svp
|
289 |
if (!preg_match('/\.svp$/i', $fname)) continue; // skip non-svp files
|
303 |
if (!preg_match('/\.svp$/', $fname)) {
|
- |
|
304 |
$okfiles = array('.', '..', '_cats.json', '_index.json', 'core');
|
- |
|
305 |
if (array_search($fname, $okfiles) !== false) continue;
|
- |
|
306 |
echo "WARNING: wild file '{$fname} (this is either an useless file that should be removed, or a misnamed package or source archive)'\n";
|
- |
|
307 |
continue;
|
- |
|
308 |
}
|
290 |
|
309 |
|
291 |
if (!preg_match('/^[a-zA-Z0-9+. _-]*\.svp$/', $fname)) {
|
310 |
if (!preg_match('/^[a-zA-Z0-9+. _-]*\.svp$/', $fname)) {
|
292 |
echo "ERROR: {$fname} has a very weird name\n";
|
311 |
echo "ERROR: {$fname} has a very weird name\n";
|
293 |
continue;
|
312 |
continue;
|
294 |
}
|
313 |
}
|