mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-08 01:15:37 +08:00
Add libc version for pre-built content name
This commit is contained in:
@@ -204,7 +204,7 @@ class Downloader
|
||||
self::unregisterCancelEvent();
|
||||
logger()->debug("Locking {$filename}");
|
||||
if ($download_as === SPC_DOWN_PRE_BUILT) {
|
||||
$name = self::getPreBuiltName($name);
|
||||
$name = self::getPreBuiltLockName($name);
|
||||
}
|
||||
self::lockSource($name, ['source_type' => 'archive', 'filename' => $filename, 'move_path' => $move_path, 'lock_as' => $download_as]);
|
||||
}
|
||||
@@ -594,7 +594,7 @@ class Downloader
|
||||
}
|
||||
}
|
||||
|
||||
public static function getPreBuiltName(string $source): string
|
||||
public static function getPreBuiltLockName(string $source): string
|
||||
{
|
||||
return "{$source}-" . PHP_OS_FAMILY . '-' . getenv('GNU_ARCH') . '-' . (getenv('SPC_LIBC') ?: 'default');
|
||||
}
|
||||
@@ -653,7 +653,7 @@ class Downloader
|
||||
}
|
||||
}
|
||||
// If lock file exists for current arch and glibc target, skip downloading
|
||||
$lock_name = self::getPreBuiltName($name);
|
||||
$lock_name = self::getPreBuiltLockName($name);
|
||||
if (!$force && $download_as === SPC_DOWN_PRE_BUILT && isset($lock[$lock_name])) {
|
||||
// lock name with env
|
||||
if (
|
||||
|
||||
@@ -55,7 +55,7 @@ class SourceManager
|
||||
throw new WrongUsageException("Source [{$source}] does not exist, please check the name and correct it !");
|
||||
}
|
||||
// check source downloaded
|
||||
$pre_built_name = Downloader::getPreBuiltName($source);
|
||||
$pre_built_name = Downloader::getPreBuiltLockName($source);
|
||||
if (!isset($lock[$pre_built_name])) {
|
||||
if (!isset($lock[$source])) {
|
||||
throw new WrongUsageException("Source [{$source}] not downloaded or not locked, you should download it first !");
|
||||
|
||||
Reference in New Issue
Block a user