From 67afffeb9618d1713d634c16cc7ea63a2acbf6e4 Mon Sep 17 00:00:00 2001 From: crazywhalecc Date: Sun, 30 Mar 2025 21:59:58 +0800 Subject: [PATCH] Remove redundant suffix, add libc version suffix --- config/pre-built.json | 3 +-- src/SPC/command/dev/PackLibCommand.php | 2 +- src/SPC/store/Downloader.php | 3 ++- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/config/pre-built.json b/config/pre-built.json index 829023c7..31264a35 100644 --- a/config/pre-built.json +++ b/config/pre-built.json @@ -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" } \ No newline at end of file diff --git a/src/SPC/command/dev/PackLibCommand.php b/src/SPC/command/dev/PackLibCommand.php index c10c62f3..fd62f3f1 100644 --- a/src/SPC/command/dev/PackLibCommand.php +++ b/src/SPC/command/dev/PackLibCommand.php @@ -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.'); } diff --git a/src/SPC/store/Downloader.php b/src/SPC/store/Downloader.php index f133f404..984cada8 100644 --- a/src/SPC/store/Downloader.php +++ b/src/SPC/store/Downloader.php @@ -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'); } /**