Remove redundant suffix, add libc version suffix

This commit is contained in:
crazywhalecc 2025-03-30 21:59:58 +08:00
parent c58ea0c3bd
commit 67afffeb96
No known key found for this signature in database
GPG Key ID: 1F4BDD59391F2680
3 changed files with 4 additions and 4 deletions

View File

@ -2,6 +2,5 @@
"repo": "static-php/static-php-cli-hosted",
"prefer-stable": true,
"match-pattern-linux": "{name}-{arch}-{os}-{libc}-{libcver}.txz",
"match-pattern": "{name}-{arch}-{os}.txz",
"suffix": "txz"
"match-pattern": "{name}-{arch}-{os}.txz"
}

View File

@ -80,7 +80,7 @@ class PackLibCommand extends BuildCommand
'{libcver}' => PHP_OS_FAMILY === 'Linux' ? (SystemUtil::getLibcVersionIfExists() ?? 'default') : 'default',
];
$filename = str_replace(array_keys($replace), array_values($replace), $filename);
$filename = WORKING_DIR . '/dist/' . $filename . '.' . Config::getPreBuilt('suffix');
$filename = WORKING_DIR . '/dist/' . $filename;
f_passthru('tar -czf ' . $filename . ' -T ' . WORKING_DIR . '/packlib_files.txt');
logger()->info('Pack library ' . $lib->getName() . ' to ' . $filename . ' complete.');
}

View File

@ -4,6 +4,7 @@ declare(strict_types=1);
namespace SPC\store;
use SPC\builder\linux\SystemUtil;
use SPC\exception\DownloaderException;
use SPC\exception\FileSystemException;
use SPC\exception\RuntimeException;
@ -596,7 +597,7 @@ class Downloader
public static function getPreBuiltLockName(string $source): string
{
return "{$source}-" . PHP_OS_FAMILY . '-' . getenv('GNU_ARCH') . '-' . (getenv('SPC_LIBC') ?: 'default');
return "{$source}-" . PHP_OS_FAMILY . '-' . getenv('GNU_ARCH') . '-' . (getenv('SPC_LIBC') ?: 'default') . '-' . (SystemUtil::getLibcVersionIfExists() ?: 'default');
}
/**