igbinary PIE

This commit is contained in:
henderkes
2026-07-23 09:16:04 +07:00
parent 347a3c3c11
commit 3b425b6b24
3 changed files with 11 additions and 8 deletions

View File

@@ -2,9 +2,9 @@ ext-igbinary:
type: php-extension
artifact:
source:
type: ghtagtar
type: pie
repo: igbinary/igbinary
match: tags/\d+(\.\d+)+$
prefer-stable: false
extract: php-src/ext/igbinary
metadata:
license-files: [COPYING]

View File

@@ -65,14 +65,17 @@ class PIE implements DownloadTypeInterface, CheckUpdateInterface
$current = array_filter($current, static fn ($v) => $v !== '__unset');
$releases[] = $current;
}
// packagist lists newest first including RC/beta/alpha — pick the newest stable release
// packagist lists newest first including RC/beta/alpha — pick the newest stable release,
// unless prefer-stable is false, then take the newest tagged release even if it's a prerelease
$first = null;
if ($config['prefer-stable'] ?? true) {
foreach ($releases as $release) {
if (!preg_match('/[._-]?(?:alpha|a|beta|b|rc)[._-]?\d*$/i', $release['version'] ?? '')) {
$first = $release;
break;
}
}
}
$first ??= $releases[0] ?? [];
if (!isset($first['php-ext'])) {
throw new DownloaderException("failed to find {$name} php-ext info from packagist, maybe not a php extension package");

View File

@@ -101,7 +101,7 @@ class ConfigValidator
'url' => [['url'], ['filename', 'extract', 'version']],
'bitbuckettag' => [['repo'], ['extract']],
'local' => [['dirname'], ['extract']],
'pie' => [['repo'], ['extract']],
'pie' => [['repo'], ['extract', 'prefer-stable']],
'pecl' => [['name'], ['extract', 'prefer-stable']],
'php-release' => [['domain'], ['extract']],
'custom' => [[], ['func']],