mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 04:44:53 +08:00
Add alt for re2c
This commit is contained in:
parent
601444d0a5
commit
be857913cd
@ -1122,6 +1122,10 @@
|
|||||||
"repo": "skvadrik/re2c",
|
"repo": "skvadrik/re2c",
|
||||||
"match": "re2c.+\\.tar\\.xz",
|
"match": "re2c.+\\.tar\\.xz",
|
||||||
"prefer-stable": true,
|
"prefer-stable": true,
|
||||||
|
"alt": {
|
||||||
|
"type": "url",
|
||||||
|
"url": "https://dl.static-php.dev/static-php-cli/deps/re2c/re2c-4.3.tar.xz"
|
||||||
|
},
|
||||||
"license": {
|
"license": {
|
||||||
"type": "file",
|
"type": "file",
|
||||||
"path": "LICENSE"
|
"path": "LICENSE"
|
||||||
|
|||||||
@ -9,6 +9,8 @@ use SPC\builder\traits\UnixSystemUtilTrait;
|
|||||||
use SPC\doctor\AsCheckItem;
|
use SPC\doctor\AsCheckItem;
|
||||||
use SPC\doctor\AsFixItem;
|
use SPC\doctor\AsFixItem;
|
||||||
use SPC\doctor\CheckResult;
|
use SPC\doctor\CheckResult;
|
||||||
|
use SPC\exception\DownloaderException;
|
||||||
|
use SPC\store\Config;
|
||||||
use SPC\store\Downloader;
|
use SPC\store\Downloader;
|
||||||
use Symfony\Component\Console\Input\ArgvInput;
|
use Symfony\Component\Console\Input\ArgvInput;
|
||||||
|
|
||||||
@ -35,7 +37,14 @@ class Re2cVersionCheck
|
|||||||
#[AsFixItem('build-re2c')]
|
#[AsFixItem('build-re2c')]
|
||||||
public function buildRe2c(): bool
|
public function buildRe2c(): bool
|
||||||
{
|
{
|
||||||
Downloader::downloadSource('re2c');
|
try {
|
||||||
|
Downloader::downloadSource('re2c');
|
||||||
|
} catch (DownloaderException) {
|
||||||
|
logger()->warning('Failed to download re2c version, trying alternative');
|
||||||
|
$alt = Config::getSource('re2c');
|
||||||
|
$alt = [...$alt, ...$alt['alt'] ?? []];
|
||||||
|
Downloader::downloadSource('re2c', $alt);
|
||||||
|
}
|
||||||
$builder = BuilderProvider::makeBuilderByInput(new ArgvInput([]));
|
$builder = BuilderProvider::makeBuilderByInput(new ArgvInput([]));
|
||||||
$builder->proveLibs(['re2c']);
|
$builder->proveLibs(['re2c']);
|
||||||
$builder->setupLibs();
|
$builder->setupLibs();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user