mirror of
https://github.com/shivammathur/setup-php.git
synced 2026-12-06 09:50:56 +00:00
Compare commits
15
Commits
florian/asan
...
develop
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8ca1ee6aee | ||
|
|
7ad1a97ee1 | ||
|
|
91a169a846 | ||
|
|
9ebeb73afd | ||
|
|
8c5b98f2bd | ||
|
|
fccdc7dba8 | ||
|
|
090470a493 | ||
|
|
a282192fbe | ||
|
|
715399fa52 | ||
|
|
4889735b89 | ||
|
|
13550279c9 | ||
|
|
e40a6698f4 | ||
|
|
a414972cd1 | ||
|
|
2f393273c0 | ||
|
|
bed5f1071b |
@@ -26,13 +26,13 @@ jobs:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@33d7b85da1a04171e211befe2c739303b9a4c066 # v4
|
||||
uses: github/codeql-action/init@915412ff23e8b7659517e607487dbeae018f2934 # v4
|
||||
with:
|
||||
config-file: ./.github/codeql/codeql-configuration.yml
|
||||
languages: javascript
|
||||
|
||||
- name: Autobuild
|
||||
uses: github/codeql-action/autobuild@33d7b85da1a04171e211befe2c739303b9a4c066 # v4
|
||||
uses: github/codeql-action/autobuild@915412ff23e8b7659517e607487dbeae018f2934 # v4
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@33d7b85da1a04171e211befe2c739303b9a4c066 # v4
|
||||
uses: github/codeql-action/analyze@915412ff23e8b7659517e607487dbeae018f2934 # v4
|
||||
|
||||
@@ -48,7 +48,7 @@ jobs:
|
||||
|
||||
- name: Setup cache environment
|
||||
id: cache-env
|
||||
uses: shivammathur/cache-extensions@695b1b465eba861efe67cbbc31252c27f5ed253d # v1
|
||||
uses: shivammathur/cache-extensions@0769e8b0c165c62888174c0fe66557ca1616ae45 # v1
|
||||
with:
|
||||
php-version: ${{ matrix.php-versions || env.default-php-version }}
|
||||
extensions: ${{ env.extensions }}
|
||||
|
||||
@@ -44,6 +44,7 @@ Setup PHP with required extensions, php.ini configuration, code-coverage support
|
||||
- [Nightly Build Setup](#nightly-build-setup)
|
||||
- [Debug Build Setup](#debug-build-setup)
|
||||
- [Thread Safe Setup](#thread-safe-setup)
|
||||
- [ASAN Build Setup](#asan-build-setup)
|
||||
- [Force Update Setup](#force-update-setup)
|
||||
- [Verbose Setup](#verbose-setup)
|
||||
- [Multi-Arch Setup](#multi-arch-setup)
|
||||
@@ -531,6 +532,13 @@ On GitHub Actions you can assign the `setup-php` step an `id`, you can use the s
|
||||
- By default, it is set to `nts`.
|
||||
- See [thread safe setup](#thread-safe-setup) for more info.
|
||||
|
||||
#### `asan` (optional)
|
||||
|
||||
- Specify to set up PHP with AddressSanitizer (ASAN) for memory error detection.
|
||||
- Accepts `true` or `false`.
|
||||
- Only available for PHP 8.0 and above on Linux runners.
|
||||
- See [ASAN build setup](#asan-build-setup) for more info.
|
||||
|
||||
#### `update` (optional)
|
||||
|
||||
- Specify to update PHP on the runner to the latest patch version.
|
||||
@@ -652,6 +660,54 @@ jobs:
|
||||
phpts: ts # specify ts or nts
|
||||
```
|
||||
|
||||
### ASAN Build Setup
|
||||
|
||||
> Set up PHP with AddressSanitizer (ASAN) for memory error detection.
|
||||
|
||||
- ASAN builds include both `AddressSanitizer` and `UndefinedBehaviorSanitizer (UBSan)`.
|
||||
- Only available for PHP 8.0 and above on Linux based runners.
|
||||
- Useful for detecting memory errors such as buffer overflows, use-after-free, and memory leaks.
|
||||
|
||||
```yaml
|
||||
jobs:
|
||||
run:
|
||||
runs-on: ubuntu-latest
|
||||
name: Setup PHP with ASAN
|
||||
steps:
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.5'
|
||||
env:
|
||||
asan: true
|
||||
```
|
||||
|
||||
You can combine ASAN with other options:
|
||||
|
||||
```yaml
|
||||
- name: Setup PHP with ASAN and thread safety
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.5'
|
||||
env:
|
||||
asan: true
|
||||
phpts: ts
|
||||
```
|
||||
|
||||
With `asan: true`, subsequent steps in the same job inherit `ASAN_OPTIONS=detect_leaks=0`, `UBSAN_OPTIONS=halt_on_error=1`, `ZEND_DONT_UNLOAD_MODULES=1`, and `USE_ZEND_ALLOC=0` by default.
|
||||
|
||||
Set a variable in the setup step's `env` to override its default for the rest of the job. To enable leak checks for a single test step, set `ASAN_OPTIONS` on that step.
|
||||
|
||||
```yaml
|
||||
- name: Run PHPUnit with leak detection
|
||||
run: vendor/bin/phpunit
|
||||
env:
|
||||
ASAN_OPTIONS: detect_leaks=1
|
||||
```
|
||||
|
||||
> [!NOTE]
|
||||
> - ASAN builds have a performance overhead due to the instrumentation, so they are recommended for testing and debugging only.
|
||||
|
||||
### Force Update Setup
|
||||
|
||||
> Update to the latest patch of PHP versions.
|
||||
@@ -1080,7 +1136,7 @@ Many users and organizations support setup-php via [GitHub Sponsors](https://git
|
||||
- [Node.js dependencies](https://github.com/shivammathur/setup-php/network/dependencies "Node.js dependencies")
|
||||
- [aaronparker/VcRedist](https://github.com/aaronparker/VcRedist "VcRedist PowerShell package")
|
||||
- [mlocati/powershell-phpmanager](https://github.com/mlocati/powershell-phpmanager "Package to handle PHP on windows")
|
||||
- [ppa:ondrej/php](https://launchpad.net/~ondrej/+archive/ubuntu/php "Packaging active PHP packages")
|
||||
- [Sury PHP packages](https://packages.sury.org/php/) and the [setup-php mirror](https://ppa.setup-php.com/sury/)
|
||||
- [shivammathur/cache-extensions](https://github.com/shivammathur/cache-extensions "GitHub action to help with caching PHP extensions")
|
||||
- [shivammathur/composer-cache](https://github.com/shivammathur/composer-cache "Cache composer releases")
|
||||
- [shivammathur/homebrew-extensions](https://github.com/shivammathur/homebrew-extensions "Tap for PHP extensions on MacOS")
|
||||
|
||||
@@ -7,7 +7,6 @@ describe('Extension tests', () => {
|
||||
${'none'} | ${'7.4'} | ${'Disable-AllShared'}
|
||||
${':intl'} | ${'7.4'} | ${'Disable-Extension intl'}
|
||||
${'ast-beta'} | ${'7.4'} | ${'Add-Extension ast beta'}
|
||||
${'ast-stable'} | ${'7.4'} | ${'Add-Extension ast stable'}
|
||||
${'blackfire'} | ${'7.3'} | ${'Add-Blackfire blackfire'}
|
||||
${'blackfire-1.31.0'} | ${'7.3'} | ${'Add-Blackfire blackfire-1.31.0'}
|
||||
${'grpc-1.2.3'} | ${'7.4'} | ${'Add-Extension grpc stable 1.2.3'}
|
||||
@@ -42,6 +41,14 @@ describe('Extension tests', () => {
|
||||
}
|
||||
);
|
||||
|
||||
it('omits the stable argument from the generated Windows command', async () => {
|
||||
const script = await extensions.addExtensionWindows(
|
||||
'mbstring-stable',
|
||||
'8.4'
|
||||
);
|
||||
expect(script.trim()).toBe('Add-Extension mbstring');
|
||||
});
|
||||
|
||||
it.each`
|
||||
extension | version | output
|
||||
${'none'} | ${'7.4'} | ${'disable_all_shared'}
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Generated
+204
-121
@@ -17,21 +17,21 @@
|
||||
"@eslint/js": "^10.0.1",
|
||||
"@types/jest": "^30.0.0",
|
||||
"@types/node": "^26.6.6",
|
||||
"@typescript-eslint/eslint-plugin": "^8.72.1",
|
||||
"@typescript-eslint/parser": "^8.72.1",
|
||||
"@typescript-eslint/eslint-plugin": "^8.73.0",
|
||||
"@typescript-eslint/parser": "^8.73.0",
|
||||
"@typescript/native": "npm:typescript@^7.0.2",
|
||||
"@vercel/ncc": "^0.45.0",
|
||||
"eslint": "^10.14.0",
|
||||
"eslint": "^10.15.0",
|
||||
"eslint-config-prettier": "^10.1.8",
|
||||
"eslint-import-resolver-typescript": "^4.4.5",
|
||||
"eslint-plugin-import-x": "^4.17.1",
|
||||
"eslint-plugin-jest": "^29.17.0",
|
||||
"eslint-plugin-import-x": "^4.18.1",
|
||||
"eslint-plugin-jest": "^29.17.1",
|
||||
"eslint-plugin-prettier": "^5.5.7",
|
||||
"globals": "^17.14.0",
|
||||
"jest": "^30.5.2",
|
||||
"jest-circus": "^30.5.2",
|
||||
"nock": "^15.0.5",
|
||||
"prettier": "^3.9.10",
|
||||
"nock": "^15.0.6",
|
||||
"prettier": "^3.10.1",
|
||||
"simple-git-hooks": "^2.14.0",
|
||||
"ts-jest": "^29.4.15",
|
||||
"typescript": "npm:@typescript/typescript6@^6.0.2"
|
||||
@@ -688,15 +688,15 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@eslint/config-array": {
|
||||
"version": "0.23.5",
|
||||
"resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.23.5.tgz",
|
||||
"integrity": "sha512-Y3kKLvC1dvTOT+oGlqNQ1XLqK6D1HU2YXPc52NmAlJZbMMWDzGYXMiPRJ8TYD39muD/OTjlZmNJ4ib7dvSrMBA==",
|
||||
"version": "0.23.7",
|
||||
"resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.23.7.tgz",
|
||||
"integrity": "sha512-Ix1tmZjA7/OmE7ROAfORe83hVnqlDzLpZVHFjHQt5mvLm1U03qMexpaxKqFIL362QV32SoPaZqmKQr3tdqFY2w==",
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@eslint/object-schema": "^3.0.5",
|
||||
"debug": "^4.3.1",
|
||||
"minimatch": "^10.2.4"
|
||||
"minimatch": "^11.0.5"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^20.19.0 || ^22.13.0 || >=24"
|
||||
@@ -840,9 +840,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@isaacs/nonrecursive-glob-match": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/@isaacs/nonrecursive-glob-match/-/nonrecursive-glob-match-1.0.3.tgz",
|
||||
"integrity": "sha512-SI7kyKHq4XXDRozw+r9GlRZkia1ZkFrpLW98r2IC2Bpr8YkFGE3fvjzmxCG0x78A++69HmDNrDvSMYBZmHGpKA==",
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@isaacs/nonrecursive-glob-match/-/nonrecursive-glob-match-1.1.0.tgz",
|
||||
"integrity": "sha512-GPm/Dbvk5RLmhRnxXIa7nTpK0xtl4E0wj0MslsuNiJ1FIROU+2+9lgUC/dgF7Ey4QCWhfEsgxilMRMCdHPfDfw==",
|
||||
"dev": true,
|
||||
"license": "BlueOak-1.0.0"
|
||||
},
|
||||
@@ -1386,9 +1386,9 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@mswjs/interceptors": {
|
||||
"version": "0.44.0",
|
||||
"resolved": "https://registry.npmjs.org/@mswjs/interceptors/-/interceptors-0.44.0.tgz",
|
||||
"integrity": "sha512-IYHevRStF4ijM20GI9c9Ndhw483NSAjCydQhUr4/zIB0BNLsTVw3vFAxTo6TlvX4QnV60wEHttUa9539TTAq+A==",
|
||||
"version": "0.45.14",
|
||||
"resolved": "https://registry.npmjs.org/@mswjs/interceptors/-/interceptors-0.45.14.tgz",
|
||||
"integrity": "sha512-2y8lEnhEKzgxSoALB7ibIPpUJ68YqWmvGjYO2D6Z4dAmMAr7kG9Poh6HiW1poT+okHGSr6LgsbqO8rDDH7MsSg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
@@ -1397,7 +1397,7 @@
|
||||
"debug": "^4.4.3",
|
||||
"is-node-process": "^1.2.0",
|
||||
"outvariant": "^1.4.3",
|
||||
"rettime": "^0.11.11"
|
||||
"rettime": "^0.11.12"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=22"
|
||||
@@ -1947,17 +1947,17 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@typescript-eslint/eslint-plugin": {
|
||||
"version": "8.72.1",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.72.1.tgz",
|
||||
"integrity": "sha512-5CokTWXpmbylfFabsbvHC0CAw3XLaGnoa+nFJX5FR592h/LoZsENUE6p/rg5xvkKrFEXz6pYmgI29AgXc2N3BQ==",
|
||||
"version": "8.74.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.74.0.tgz",
|
||||
"integrity": "sha512-z3KXk1+Vm+d82ZRplOoC89ho4Rf1da5ju6sx8//92GnN532U62DGPjECXkkVqtYzIv0zoJlpO39SX2Z9tk6LVw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@eslint-community/regexpp": "^4.12.2",
|
||||
"@typescript-eslint/scope-manager": "8.72.1",
|
||||
"@typescript-eslint/type-utils": "8.72.1",
|
||||
"@typescript-eslint/utils": "8.72.1",
|
||||
"@typescript-eslint/visitor-keys": "8.72.1",
|
||||
"@typescript-eslint/scope-manager": "8.74.0",
|
||||
"@typescript-eslint/type-utils": "8.74.0",
|
||||
"@typescript-eslint/utils": "8.74.0",
|
||||
"@typescript-eslint/visitor-keys": "8.74.0",
|
||||
"ignore": "^7.0.5",
|
||||
"natural-compare": "^1.4.0",
|
||||
"ts-api-utils": "^2.5.0"
|
||||
@@ -1970,22 +1970,22 @@
|
||||
"url": "https://opencollective.com/typescript-eslint"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@typescript-eslint/parser": "^8.72.1",
|
||||
"@typescript-eslint/parser": "^8.74.0",
|
||||
"eslint": "^8.57.0 || ^9.0.0 || ^10.0.0",
|
||||
"typescript": ">=4.8.4 <6.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/parser": {
|
||||
"version": "8.72.1",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.72.1.tgz",
|
||||
"integrity": "sha512-ZGwZP4OCfyA0AQTpEAMWz+rtX01DRhQWW5hB0ucKDEIX5U7jdmPSaMx94rQfaPAQzIYz2BimOgKOJtjfpRFQ9g==",
|
||||
"version": "8.74.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.74.0.tgz",
|
||||
"integrity": "sha512-ecr8AYdig7avVkxaHdQvxHnIJ/mOyliO4Gv/uWF8q69vBew/z3sexqBwHUZX5Vql+Ns0w4sH6gBLkICGbOvJkA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@typescript-eslint/scope-manager": "8.72.1",
|
||||
"@typescript-eslint/types": "8.72.1",
|
||||
"@typescript-eslint/typescript-estree": "8.72.1",
|
||||
"@typescript-eslint/visitor-keys": "8.72.1",
|
||||
"@typescript-eslint/scope-manager": "8.74.0",
|
||||
"@typescript-eslint/types": "8.74.0",
|
||||
"@typescript-eslint/typescript-estree": "8.74.0",
|
||||
"@typescript-eslint/visitor-keys": "8.74.0",
|
||||
"debug": "^4.4.3"
|
||||
},
|
||||
"engines": {
|
||||
@@ -2000,15 +2000,49 @@
|
||||
"typescript": ">=4.8.4 <6.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/project-service": {
|
||||
"version": "8.72.1",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.72.1.tgz",
|
||||
"integrity": "sha512-fAuVMkwdO/huI8nyo/WKnNKf6Gag93S56Rh3Ts5mGcavwSdaN8tRg1gCeIGX8PF+nzp1BjGfO4gHhGzW1J6jTg==",
|
||||
"node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/typescript-estree": {
|
||||
"version": "8.74.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.74.0.tgz",
|
||||
"integrity": "sha512-wL348k6l92DNG+kPP5rVpKwNBoz7a3xRZy3TPKc1uymQttd7u7gcMv3eENmcuh4CjC4mO3FTM0DYstFXMyDLuw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@typescript-eslint/tsconfig-utils": "^8.72.1",
|
||||
"@typescript-eslint/types": "^8.72.1",
|
||||
"@typescript-eslint/project-service": "8.74.0",
|
||||
"@typescript-eslint/tsconfig-utils": "8.74.0",
|
||||
"@typescript-eslint/types": "8.74.0",
|
||||
"@typescript-eslint/visitor-keys": "8.74.0",
|
||||
"debug": "^4.4.3",
|
||||
"minimatch": "^11.0.1",
|
||||
"semver": "^7.7.3",
|
||||
"tinyglobby": "^0.2.15",
|
||||
"ts-api-utils": "^2.5.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/typescript-eslint"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@typescript/native": "npm:typescript@>=7.1.0-dev.20261009.1 || >=7.1.0-beta <7.1.0-dev",
|
||||
"typescript": ">=4.8.4 <6.1.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"@typescript/native": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/project-service": {
|
||||
"version": "8.74.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.74.0.tgz",
|
||||
"integrity": "sha512-z/mymuE+JlEeSFIv3Mo70EvgG1Zz74Hl0IDfExfXutARAP834bt+MppTD7mVAwmZO0GdxdOAi0jbTam749eH6g==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@typescript-eslint/tsconfig-utils": "^8.74.0",
|
||||
"@typescript-eslint/types": "^8.74.0",
|
||||
"debug": "^4.4.3"
|
||||
},
|
||||
"engines": {
|
||||
@@ -2023,14 +2057,14 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/scope-manager": {
|
||||
"version": "8.72.1",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.72.1.tgz",
|
||||
"integrity": "sha512-lC/t6eMCZZQAAKZEYGL6RDVSuFehpdmMT6h+nJIjIa6oylN/PwDgDVtEIbB7O9xFfZYtZAYLoLlDNWKJhtF+uQ==",
|
||||
"version": "8.74.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.74.0.tgz",
|
||||
"integrity": "sha512-kpOdpu4CpWN5U38ox3f727DwWRBtUAVhyUJtqTBYe5gf2wYoxac7PgKP14txrxN7ICVtcjlLdzjqfRgpSnDKvQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@typescript-eslint/types": "8.72.1",
|
||||
"@typescript-eslint/visitor-keys": "8.72.1"
|
||||
"@typescript-eslint/types": "8.74.0",
|
||||
"@typescript-eslint/visitor-keys": "8.74.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
||||
@@ -2041,9 +2075,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/tsconfig-utils": {
|
||||
"version": "8.72.1",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.72.1.tgz",
|
||||
"integrity": "sha512-e4D5R5vpeAEPBxT2BAzsFQL3sbwyeeeo5+aczgNSRK1V734jE7pTqaGFU+fXapWEQwnZbpFaTn32+Z8DwS6OTg==",
|
||||
"version": "8.74.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.74.0.tgz",
|
||||
"integrity": "sha512-p07wAuaS6BjCYgOSXKJi4YhvTnAf7fiG37e9THcpnYaQEt2QiTTYZWKwUFNgeRiywiMudazhzgddAirZ0GgHtQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
@@ -2058,15 +2092,15 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/type-utils": {
|
||||
"version": "8.72.1",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.72.1.tgz",
|
||||
"integrity": "sha512-iY2wlmyrXJmx4yxUGP3aYCFF3cA/6ShddOKmLU2dx7LnEykbAM8WThlxZEfd1NddqceF6eJmZUayxx9oKIYNlg==",
|
||||
"version": "8.74.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.74.0.tgz",
|
||||
"integrity": "sha512-CV3Y3la8l3F9ANfxcfpgSSiQgJTe4IeLEoZV4O/gcW86Ugp8X6SKiQ0vm+QegXaRIbbDMokZZSF3A1CgiU/kPw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@typescript-eslint/types": "8.72.1",
|
||||
"@typescript-eslint/typescript-estree": "8.72.1",
|
||||
"@typescript-eslint/utils": "8.72.1",
|
||||
"@typescript-eslint/types": "8.74.0",
|
||||
"@typescript-eslint/typescript-estree": "8.74.0",
|
||||
"@typescript-eslint/utils": "8.74.0",
|
||||
"debug": "^4.4.3",
|
||||
"ts-api-utils": "^2.5.0"
|
||||
},
|
||||
@@ -2082,33 +2116,19 @@
|
||||
"typescript": ">=4.8.4 <6.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/types": {
|
||||
"version": "8.72.1",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.72.1.tgz",
|
||||
"integrity": "sha512-LmE5IhQet1BWOWEXqBrVtBPsMAOQ6Nzk35d+WLh3mk4EUF33sqlfxjio1MdYeSvKSG5skactKKuixBIKXhL4Rw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/typescript-eslint"
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/typescript-estree": {
|
||||
"version": "8.72.1",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.72.1.tgz",
|
||||
"integrity": "sha512-DAlUoUV93hIvrtIQLwCbmZQYVZwOMhiHJrOVUUIWicFZaIYjTRqlY3I/NZevfkLmSqkNHRu2qYDcq9lrn16oOQ==",
|
||||
"node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/typescript-estree": {
|
||||
"version": "8.74.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.74.0.tgz",
|
||||
"integrity": "sha512-wL348k6l92DNG+kPP5rVpKwNBoz7a3xRZy3TPKc1uymQttd7u7gcMv3eENmcuh4CjC4mO3FTM0DYstFXMyDLuw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@typescript-eslint/project-service": "8.72.1",
|
||||
"@typescript-eslint/tsconfig-utils": "8.72.1",
|
||||
"@typescript-eslint/types": "8.72.1",
|
||||
"@typescript-eslint/visitor-keys": "8.72.1",
|
||||
"@typescript-eslint/project-service": "8.74.0",
|
||||
"@typescript-eslint/tsconfig-utils": "8.74.0",
|
||||
"@typescript-eslint/types": "8.74.0",
|
||||
"@typescript-eslint/visitor-keys": "8.74.0",
|
||||
"debug": "^4.4.3",
|
||||
"minimatch": "^10.2.2",
|
||||
"minimatch": "^11.0.1",
|
||||
"semver": "^7.7.3",
|
||||
"tinyglobby": "^0.2.15",
|
||||
"ts-api-utils": "^2.5.0"
|
||||
@@ -2121,20 +2141,40 @@
|
||||
"url": "https://opencollective.com/typescript-eslint"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@typescript/native": "npm:typescript@>=7.1.0-dev.20261009.1 || >=7.1.0-beta <7.1.0-dev",
|
||||
"typescript": ">=4.8.4 <6.1.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"@typescript/native": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/types": {
|
||||
"version": "8.74.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.74.0.tgz",
|
||||
"integrity": "sha512-MpnMrJCVNpP1iVL8NiHkQZgQqIMBH5ewDGUPBh1pqQXwFtMFjsl1M03QcYPXmv6stCKEiF0PN7CGbU1ZbXFzEA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/typescript-eslint"
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/utils": {
|
||||
"version": "8.72.1",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.72.1.tgz",
|
||||
"integrity": "sha512-5v5liypurJBFHCBNqh/RjsymAD+VWcE0djuGY/BUqp5fC3Qn+luWDEksjuTtWjPn6i5zQlUtkZCRG/CYG0yCkA==",
|
||||
"version": "8.74.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.74.0.tgz",
|
||||
"integrity": "sha512-IpWXPxXXomzxyTcvjhZJexgdvtTR1TooLAPpuxzaGqQ8BHll1lf4Ysp/BTE/l0U5TJ+x1j7B4bEM8pLRrvY+XA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@eslint-community/eslint-utils": "^4.9.1",
|
||||
"@typescript-eslint/scope-manager": "8.72.1",
|
||||
"@typescript-eslint/types": "8.72.1",
|
||||
"@typescript-eslint/typescript-estree": "8.72.1"
|
||||
"@typescript-eslint/scope-manager": "8.74.0",
|
||||
"@typescript-eslint/types": "8.74.0",
|
||||
"@typescript-eslint/typescript-estree": "8.74.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
||||
@@ -2148,14 +2188,48 @@
|
||||
"typescript": ">=4.8.4 <6.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/visitor-keys": {
|
||||
"version": "8.72.1",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.72.1.tgz",
|
||||
"integrity": "sha512-SB8xqipSzZHUePCCLNeYxqnxq83X61/qzNhjQGbTfjxGZIeOEP7tBgWYX05Tcd6CgE02WdTJnh5b8kMZJ/+bnQ==",
|
||||
"node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/typescript-estree": {
|
||||
"version": "8.74.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.74.0.tgz",
|
||||
"integrity": "sha512-wL348k6l92DNG+kPP5rVpKwNBoz7a3xRZy3TPKc1uymQttd7u7gcMv3eENmcuh4CjC4mO3FTM0DYstFXMyDLuw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@typescript-eslint/types": "8.72.1",
|
||||
"@typescript-eslint/project-service": "8.74.0",
|
||||
"@typescript-eslint/tsconfig-utils": "8.74.0",
|
||||
"@typescript-eslint/types": "8.74.0",
|
||||
"@typescript-eslint/visitor-keys": "8.74.0",
|
||||
"debug": "^4.4.3",
|
||||
"minimatch": "^11.0.1",
|
||||
"semver": "^7.7.3",
|
||||
"tinyglobby": "^0.2.15",
|
||||
"ts-api-utils": "^2.5.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/typescript-eslint"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@typescript/native": "npm:typescript@>=7.1.0-dev.20261009.1 || >=7.1.0-beta <7.1.0-dev",
|
||||
"typescript": ">=4.8.4 <6.1.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"@typescript/native": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/visitor-keys": {
|
||||
"version": "8.74.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.74.0.tgz",
|
||||
"integrity": "sha512-XSZmOtMUbWCBIM+2BK134FyMFxmll1mW2mPLk/PSwYQYzGIPMgJAqL929U4qXVizLv7Xq5b7r41/o7Ombuwk0g==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@typescript-eslint/types": "8.74.0",
|
||||
"eslint-visitor-keys": "^5.0.0"
|
||||
},
|
||||
"engines": {
|
||||
@@ -3413,9 +3487,9 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/cross-spawn": {
|
||||
"version": "7.0.6",
|
||||
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",
|
||||
"integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==",
|
||||
"version": "7.1.2",
|
||||
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.1.2.tgz",
|
||||
"integrity": "sha512-8BPK2r+sKWC8sDinRwLwrFMq2lXTBBwzYYEB9LiCznfMurOi4FOvQflq3XOLGG+HPdMSVpe+k/s96+AtDEOgPg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
@@ -3565,9 +3639,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/eslint": {
|
||||
"version": "10.14.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint/-/eslint-10.14.0.tgz",
|
||||
"integrity": "sha512-T0pNsxkb9IKmtQjhpK3d7nWOpFv+YHuMbTJnSVMoQblF0onvXfErrtp4V1jHtsQPan7dKaGVD0q1WCXnzMF31A==",
|
||||
"version": "10.16.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint/-/eslint-10.16.0.tgz",
|
||||
"integrity": "sha512-Xu3PRLG/wCaZWZ20gkExUcNqL2mWWsXTR+Lln3Sof4Y9WuA678fH9hrlQ8B6UNwbTnsKdDdBYOd2jxtycXVTGQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"workspaces": [
|
||||
@@ -3576,7 +3650,7 @@
|
||||
"dependencies": {
|
||||
"@eslint-community/eslint-utils": "^4.8.0",
|
||||
"@eslint-community/regexpp": "^4.12.2",
|
||||
"@eslint/config-array": "^0.23.5",
|
||||
"@eslint/config-array": "^0.23.7",
|
||||
"@eslint/config-helpers": "^0.7.0",
|
||||
"@eslint/core": "^1.2.1",
|
||||
"@eslint/plugin-kit": "^0.7.3",
|
||||
@@ -3601,7 +3675,7 @@
|
||||
"imurmurhash": "^0.1.4",
|
||||
"is-glob": "^4.0.0",
|
||||
"json-stable-stringify-without-jsonify": "^1.0.1",
|
||||
"minimatch": "^10.2.6",
|
||||
"minimatch": "^11.0.5",
|
||||
"natural-compare": "^1.4.0",
|
||||
"optionator": "^0.9.3"
|
||||
},
|
||||
@@ -3700,18 +3774,20 @@
|
||||
}
|
||||
},
|
||||
"node_modules/eslint-plugin-import-x": {
|
||||
"version": "4.17.1",
|
||||
"resolved": "https://registry.npmjs.org/eslint-plugin-import-x/-/eslint-plugin-import-x-4.17.1.tgz",
|
||||
"integrity": "sha512-4cdstYkKCyjumM2Q9NSI03K8D2a9F4Ssz33K2lv2hQa4KmR9jPLwk3uWGtNvclfqBrPGfGuMBwsGMbe6dMRbfg==",
|
||||
"version": "4.18.1",
|
||||
"resolved": "https://registry.npmjs.org/eslint-plugin-import-x/-/eslint-plugin-import-x-4.18.1.tgz",
|
||||
"integrity": "sha512-D1h++38NS2Z40zf8jbd2OHqDrnIFRKpdp8sL0jP4xSDGZj6MNwEQua8F+r3tOWjcHrsWuhHOJ7wASWioJ31tfg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@typescript-eslint/types": "^8.56.0",
|
||||
"cjs-module-lexer": "^2.2.1",
|
||||
"comment-parser": "^1.4.1",
|
||||
"debug": "^4.4.1",
|
||||
"es-module-lexer": "^3.0.3",
|
||||
"eslint-import-context": "^0.1.9",
|
||||
"is-glob": "^4.0.3",
|
||||
"minimatch": "^9.0.3 || ^10.1.2",
|
||||
"minimatch": "^9.0.3 || ^10.1.2 || ^11.0.1",
|
||||
"semver": "^7.7.2",
|
||||
"stable-hash-x": "^0.2.0",
|
||||
"unrs-resolver": "^1.9.2"
|
||||
@@ -3736,10 +3812,17 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/eslint-plugin-import-x/node_modules/es-module-lexer": {
|
||||
"version": "3.0.5",
|
||||
"resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-3.0.5.tgz",
|
||||
"integrity": "sha512-RNq2lKJw53c7z9QRHeiKeA6Ez0oikOqiBGdmxQhKDxEiOX1g5QJR4IoFVwicn8uCZcRWNrXC3NZaJihgK7aEbg==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/eslint-plugin-jest": {
|
||||
"version": "29.17.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-29.17.0.tgz",
|
||||
"integrity": "sha512-6jtpU6MhYKbagkES02TupWAUUooJpZtKg94Ax0b8HhUorv3InSTBU8RRtlSBe0LocOcShXOpyec3PHzPDkJCSg==",
|
||||
"version": "29.17.2",
|
||||
"resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-29.17.2.tgz",
|
||||
"integrity": "sha512-PkDicB9njFXWby0rfpHSMGLkNf37c6EavIDUPNXVv1BGRLyr1nnea4jRc1EFOlUTZCW5iGzVGGHXb/siEf+QmQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
@@ -4171,13 +4254,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/glob": {
|
||||
"version": "14.0.3",
|
||||
"resolved": "https://registry.npmjs.org/glob/-/glob-14.0.3.tgz",
|
||||
"integrity": "sha512-A1vjIwC3qpdCso45Iw127gnp7sPhqgY8lUQhDrArIs+GbmfaaVPFuoyy7WyLT9EPZCRZ7j7aLdwUhQmHWesEow==",
|
||||
"version": "14.0.7",
|
||||
"resolved": "https://registry.npmjs.org/glob/-/glob-14.0.7.tgz",
|
||||
"integrity": "sha512-ob8P0VbyEjcLG2ycNYmzYhZj65kkcN5b7tt5moGhTq3rkXtuU8MB+i0GIzPtLnSHVF2DkK4M+nQRojDvsOGVJw==",
|
||||
"dev": true,
|
||||
"license": "BlueOak-1.0.0",
|
||||
"dependencies": {
|
||||
"minimatch": "^11.0.2",
|
||||
"minimatch": "^11.0.5",
|
||||
"minipass": "^7.1.3",
|
||||
"path-scurry": "^3.0.0"
|
||||
},
|
||||
@@ -5219,17 +5302,17 @@
|
||||
}
|
||||
},
|
||||
"node_modules/minimatch": {
|
||||
"version": "11.0.3",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-11.0.3.tgz",
|
||||
"integrity": "sha512-iny/40PEGkNJQ5/Pv6z3nm6FbRAby32GeZRjCUJk2WnNDbgPSTcdI+DDvLqsgBdD4cD5sMtMheqPPnehCCa8Nw==",
|
||||
"version": "11.0.10",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-11.0.10.tgz",
|
||||
"integrity": "sha512-L3/cjhQ5E6lft0VCp/2mO3Ic74RnutKy3rz7iGwp/6w1hKcO262g2rbfacFyw6eBig5OdI0nu5PpuA0/WQs9Tw==",
|
||||
"dev": true,
|
||||
"license": "BlueOak-1.0.0",
|
||||
"dependencies": {
|
||||
"@isaacs/nonrecursive-glob-match": "^1.0.3",
|
||||
"@isaacs/nonrecursive-glob-match": "^1.1.0",
|
||||
"brace-expansion": "^5.0.12"
|
||||
},
|
||||
"engines": {
|
||||
"node": "18 || 20 || >=22"
|
||||
"node": "20 || >=22"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/isaacs"
|
||||
@@ -5293,13 +5376,13 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/nock": {
|
||||
"version": "15.0.5",
|
||||
"resolved": "https://registry.npmjs.org/nock/-/nock-15.0.5.tgz",
|
||||
"integrity": "sha512-nVeuZGS2we1PyvqbW082Qj0EB4bd//6pZk/zOPDlaTPU72qcWrqfHg3kx9JcBcH1fJxwJHjmsfuQ4mss42su4w==",
|
||||
"version": "15.0.7",
|
||||
"resolved": "https://registry.npmjs.org/nock/-/nock-15.0.7.tgz",
|
||||
"integrity": "sha512-BH7UHCRo/zHX0PT0oyz6RH0KZwkYo6TiSF5eJ3gg8lrvtSW6aKiNAXTmWUbHxmjMfvvrTT0ygl7/WM15XoAthg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@mswjs/interceptors": "^0.44.0"
|
||||
"@mswjs/interceptors": "^0.45.14"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=22.20.0"
|
||||
@@ -5611,9 +5694,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/prettier": {
|
||||
"version": "3.9.10",
|
||||
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.9.10.tgz",
|
||||
"integrity": "sha512-skGHTH1Yb9QvaTC4hWnRTzEYtCpApF0UMBPz+t/0ZPzP8ihefo/btKd+QA7pUE0fEwA1SbS/NmhyEcstdXOIdA==",
|
||||
"version": "3.10.1",
|
||||
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.10.1.tgz",
|
||||
"integrity": "sha512-70vp3ZUYoPlFbF9uiTdXHUUCGEIp7d4+6p+8DYbkm2jP7x/3i/paXVF6dopSI3zd/CEitrZN1rc4i85xWmmXlg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"bin": {
|
||||
@@ -5759,9 +5842,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/rettime": {
|
||||
"version": "0.11.12",
|
||||
"resolved": "https://registry.npmjs.org/rettime/-/rettime-0.11.12.tgz",
|
||||
"integrity": "sha512-5ExtR1ppiDBQkVoPw5NAqdbfH4Iq2VOmQKHMtUoaFxA9bo2krzFYBtyq6K40xxbYp+2w/YOr6D+1ToF6tTN53A==",
|
||||
"version": "0.11.13",
|
||||
"resolved": "https://registry.npmjs.org/rettime/-/rettime-0.11.13.tgz",
|
||||
"integrity": "sha512-kzDWDmrxn6KPqqyFaBcXtV+GzaUzgYulSrWBetyxsPZjlXabWoeg3uZJU+zK/TnFUtkWC2Yw7J/VAWYnzy0tRA==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
|
||||
+1
-1
@@ -65,7 +65,7 @@
|
||||
},
|
||||
"overrides": {
|
||||
"glob": "^14.0.3",
|
||||
"minimatch": "^11.0.3"
|
||||
"minimatch": "^11.0.10"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/shivammathur/setup-php/issues"
|
||||
|
||||
+1
-1
@@ -180,7 +180,7 @@ export async function addExtensionWindows(
|
||||
add_script += await utils.joins(
|
||||
'\nAdd-Extension',
|
||||
ext_name,
|
||||
ext_version
|
||||
ext_version.replace('stable', '')
|
||||
);
|
||||
break;
|
||||
// match extensions for compiling from source
|
||||
|
||||
@@ -167,8 +167,9 @@ get_pecl_version() {
|
||||
local extension=$1
|
||||
local requested=${2:-stable}
|
||||
local states=("stable" "rc" "preview" "beta" "alpha" "devel" "snapshot")
|
||||
local curl_opts=("${curl_opts[@]}" --fail)
|
||||
local stability major_version response pecl_version pattern
|
||||
response=$(get -s -n "" "https://pecl.php.net/rest/r/$extension/allreleases.xml")
|
||||
response=$(get -s -n "" "https://pecl.php.net/rest/r/$extension/allreleases.xml") || response=
|
||||
if [[ "$requested" =~ ^[0-9] ]]; then
|
||||
# Preserve exact pins and PECL's case-sensitive archive directory names.
|
||||
pecl_version=$(echo "$response" | grep -Fio "<v>$requested</v>" | head -n 1 | cut -d '>' -f 2 | cut -d '<' -f 1)
|
||||
@@ -176,6 +177,10 @@ get_pecl_version() {
|
||||
return
|
||||
fi
|
||||
requested="$(echo "$requested" | tr '[:upper:]' '[:lower:]')"
|
||||
# Only relax stable when the complete PECL release list contains no stable release.
|
||||
if [[ "$requested" = stable && "$response" = *'<r>'*'</r>'*'</a>'* ]] && ! grep -Fqi '<s>stable</s>' <<< "$response"; then
|
||||
requested=snapshot
|
||||
fi
|
||||
[[ " ${states[*]} " = *" $requested "* ]] || return 0
|
||||
IFS=' ' read -r -a states <<< "$(echo "${states[@]}" | grep -Eo ".*$requested")"
|
||||
stability="$(IFS='|' ; echo "${states[*]}")"
|
||||
|
||||
@@ -75,7 +75,7 @@ add_http_latest() {
|
||||
if [ "$os" = "Linux" ]; then
|
||||
add_http_dependencies
|
||||
package="php$version-http"
|
||||
add_ppa ondrej/php >/dev/null 2>&1 || update_ppa ondrej/php
|
||||
add_ppa >/dev/null 2>&1
|
||||
(check_package "$package" && install_packages "$package") || add_http_helper "$(get_http_version)" "$os"
|
||||
else
|
||||
if ! [[ "${version:?}" =~ ${old_versions:?} ]]; then
|
||||
|
||||
@@ -36,7 +36,7 @@ add_phalcon_helper() {
|
||||
add_brew_extension "$extension" extension
|
||||
else
|
||||
package="php${version:?}-$extension"
|
||||
add_ppa ondrej/php >/dev/null 2>&1 || update_ppa ondrej/php
|
||||
add_ppa >/dev/null 2>&1
|
||||
[[ "$extension" =~ phalcon[4|5] ]] && (install_packages "php${version:?}-psr" || pecl_install psr || pecl_install psr-1.1.0)
|
||||
(check_package "$package" && install_packages "$package") || pecl_install phalcon-"$(get_phalcon_version)" || add_phalcon_from_repo
|
||||
fi
|
||||
|
||||
+10
-4
@@ -104,7 +104,7 @@ filter_packages() {
|
||||
add_extension_helper() {
|
||||
local extension=$1
|
||||
packages=(php"$version"-"$extension")
|
||||
add_ppa ondrej/php >/dev/null 2>&1 || update_ppa ondrej/php
|
||||
add_ppa >/dev/null 2>&1
|
||||
[ "${debug:?}" = "debug" ] && check_package php"$version"-"$extension"-dbgsym && packages+=(php"$version"-"$extension"-dbgsym)
|
||||
(check_package "${packages[0]}" && install_packages "${packages[@]}") || pecl_install "$extension"
|
||||
add_extension_log "$extension" "Installed and enabled"
|
||||
@@ -124,7 +124,11 @@ add_devtools() {
|
||||
|
||||
# Function to setup PHP from the shivammathur/php-builder builds.
|
||||
setup_php_builder() {
|
||||
run_script "php-builder" "${runner:?}" "$version" "${debug:?}" "${ts:?}"
|
||||
if [[ -n "${asan:-}" && "$version" =~ ${no_asan_builds:?} ]]; then
|
||||
add_log "${cross:?}" "PHP" "ASAN is only supported for PHP 8.0+"
|
||||
exit 1
|
||||
fi
|
||||
run_script "php-builder" "${runner:?}" "$version" "${debug:?}" "${ts:?}" "${asan:-}"
|
||||
}
|
||||
|
||||
# Function to setup PHP 5.3, PHP 5.4 and PHP 5.5.
|
||||
@@ -217,7 +221,7 @@ get_php_packages() {
|
||||
|
||||
# Function to install packaged PHP
|
||||
add_packaged_php() {
|
||||
add_ppa ondrej/php >/dev/null 2>&1 || update_ppa ondrej/php
|
||||
add_ppa >/dev/null 2>&1
|
||||
IFS=' ' read -r -a packages <<<"$(get_php_packages)"
|
||||
install_packages "${packages[@]}"
|
||||
}
|
||||
@@ -237,7 +241,9 @@ update_php() {
|
||||
# Function to install PHP.
|
||||
add_php() {
|
||||
if [ "${runner:?}" = "self-hosted" ] || [ "${use_builds_cache:-true}" = "false" ]; then
|
||||
if [[ "$version" =~ ${php_builder_versions:?} || "$ts" = "zts" ]]; then
|
||||
# Sury's Ubuntu archive does not publish the PHP CLI debug symbols.
|
||||
if [[ "$version" =~ ${php_builder_versions:?} || "$ts" = "zts" || -n "${asan:-}" ||
|
||||
( "$debug" = "debug" && "$ID $ID_LIKE" == *ubuntu* ) ]]; then
|
||||
setup_php_builder
|
||||
else
|
||||
add_packaged_php
|
||||
|
||||
@@ -403,27 +403,30 @@ Function Add-ComposerToolHelper() {
|
||||
}
|
||||
return composer global show $prefix$tool 2>&1 | findstr '^versions'
|
||||
} else {
|
||||
$release_stream = [System.IO.MemoryStream]::New([System.Text.Encoding]::ASCII.GetBytes($release))
|
||||
$scoped_dir_suffix = (Get-FileHash -InputStream $release_stream -Algorithm sha256).Hash
|
||||
$scoped_dir = "$composer_bin\_tools\$tool-$scoped_dir_suffix"
|
||||
$scoped_dir = "$composer_bin\_tools\$tool"
|
||||
$unix_scoped_dir = $scoped_dir.replace('\', '/')
|
||||
if(-not(Test-Path $scoped_dir\vendor\autoload.php)) {
|
||||
New-Item -ItemType Directory -Force -Path $scoped_dir > $null 2>&1
|
||||
Set-Content -Path $scoped_dir\composer.json -Value "{}"
|
||||
$log = if((Test-Path $scoped_dir\vendor\autoload.php) -and $tool_version -match '^v?\d+\.\d+\.\d+([-+][a-zA-Z0-9.+-]+)?$') {
|
||||
composer show $prefix$tool $tool_version -d $unix_scoped_dir 2>$null | findstr '^versions'
|
||||
}
|
||||
if(-not $log) {
|
||||
if($tool_version -eq 'latest') { $tool_version = '*' }
|
||||
if(-not(Test-Path $scoped_dir\composer.json)) {
|
||||
New-Item -ItemType File -Path $scoped_dir\composer.json -Value '{}' -Force >$null
|
||||
}
|
||||
if((composer show $prefix$tool $tool_version -d $unix_scoped_dir -a 2>&1 | findstr '^type *: *composer-plugin') -and ($composer_args -ne '')) {
|
||||
composer config -d $unix_scoped_dir --no-plugins allow-plugins."$prefix$tool" true >$null 2>&1
|
||||
}
|
||||
composer require $prefix$release -d $unix_scoped_dir $composer_args >$null 2>&1
|
||||
composer require "$prefix${tool}:$tool_version" -d $unix_scoped_dir --update-with-dependencies $composer_args >$null 2>&1
|
||||
if($LASTEXITCODE -ne 0) {
|
||||
return
|
||||
}
|
||||
}
|
||||
$log = composer show $prefix$tool -d $unix_scoped_dir 2>&1 | findstr '^versions'
|
||||
}
|
||||
if(-not $log) {
|
||||
return
|
||||
}
|
||||
[System.Environment]::SetEnvironmentVariable(($tool.replace('-', '_') + '_bin'), "$scoped_dir\vendor\bin")
|
||||
Add-Path $scoped_dir\vendor\bin
|
||||
Add-Path $scoped_dir\vendor\bin -Force:(Test-Path -LiteralPath "$scoped_dir\phar\$tool.bat")
|
||||
return $log
|
||||
}
|
||||
}
|
||||
@@ -478,6 +481,14 @@ Function Add-ComposerTool() {
|
||||
Add-Log $tick $tool "Added $tool $tool_version"
|
||||
} elseif($fallback_url) {
|
||||
Add-Log "!" $tool "Could not setup $tool using Composer. Falling back to PHAR."
|
||||
if($scope -eq 'scoped') {
|
||||
$bin_dir = "$composer_bin\_tools\$tool\phar"
|
||||
New-Item -ItemType Directory -Path $bin_dir -Force >$null
|
||||
Add-Path $bin_dir -Force
|
||||
$env:PATH = "$bin_dir;$env:PATH"
|
||||
$alias_command = "Set-Alias $tool $tool.bat"
|
||||
Add-ToProfile $current_profile "/C:$alias_command" $alias_command
|
||||
}
|
||||
Add-Tool $fallback_url $tool $fallback_version_parameter
|
||||
} else {
|
||||
Add-Log $cross $tool "Could not setup $tool"
|
||||
|
||||
@@ -333,18 +333,24 @@ add_composer_tool_helper() {
|
||||
composer global require "$prefix$release" "$composer_args" >/dev/null 2>&1 || return 1
|
||||
composer global show "$prefix$tool" 2>&1 | grep -E ^versions | sudo tee /tmp/composer.log >/dev/null 2>&1
|
||||
else
|
||||
scoped_dir="$composer_bin/_tools/$tool-$(echo -n "$release" | shasum -a 256 | cut -d ' ' -f 1)"
|
||||
if ! [ -f "$scoped_dir/vendor/autoload.php" ]; then
|
||||
scoped_dir="$composer_bin/_tools/$tool"
|
||||
if [[ ! -f "$scoped_dir/vendor/autoload.php" || ! "$tool_version" =~ ^v?[0-9]+\.[0-9]+\.[0-9]+([-+][a-zA-Z0-9.+-]+)?$ ]] ||
|
||||
! composer show "$prefix$tool" "$tool_version" -d "$scoped_dir" 2>/dev/null | grep '^versions' > /tmp/composer.log; then
|
||||
[ "$tool_version" != latest ] || tool_version='*'
|
||||
mkdir -p "$scoped_dir"
|
||||
echo '{}' | tee "$scoped_dir/composer.json" >/dev/null
|
||||
[ -f "$scoped_dir/composer.json" ] || echo '{}' > "$scoped_dir/composer.json"
|
||||
if composer show "$prefix$tool" "$tool_version" -d "$scoped_dir" -a 2>&1 | grep -qE '^type *: *composer-plugin' && [ -n "$composer_args" ]; then
|
||||
composer config -d "$scoped_dir" --no-plugins allow-plugins."$prefix$tool" true >/dev/null 2>&1
|
||||
fi
|
||||
composer require "$prefix$release" -d "$scoped_dir" "$composer_args" >/dev/null 2>&1 || return 1
|
||||
composer require "$prefix$tool:$tool_version" -d "$scoped_dir" --update-with-dependencies ${composer_args:+"$composer_args"} >/dev/null 2>&1 || return 1
|
||||
composer show "$prefix$tool" -d "$scoped_dir" 2>/dev/null | grep '^versions' > /tmp/composer.log
|
||||
fi
|
||||
composer show "$prefix$tool" -d "$scoped_dir" 2>&1 | grep -E ^versions | sudo tee /tmp/composer.log >/dev/null 2>&1
|
||||
[ -s /tmp/composer.log ] || return 1
|
||||
add_path "$scoped_dir"/vendor/bin
|
||||
# Switch the fallback's tool-cache link back to the Composer launcher.
|
||||
if [[ -L "$tool_cache_path_dir/$tool" && "$(readlink "$tool_cache_path_dir/$tool")" = "$scoped_dir/phar/$tool" ]]; then
|
||||
sudo ln -sfn "$scoped_dir/vendor/bin/$tool" "$tool_cache_path_dir/$tool"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -372,7 +378,12 @@ add_composer_tool() {
|
||||
add_log "$tick" "$tool" "Added $tool $tool_version"
|
||||
elif [ -n "$fallback_url" ]; then
|
||||
add_log "!" "$tool" "Could not setup $tool using Composer. Falling back to PHAR."
|
||||
if [ "$scope" = scoped ]; then
|
||||
# Keep the PHAR private. Only its tool-cache link belongs on the runner PATH.
|
||||
PATH="$scoped_dir/phar:$PATH" tool_path_dir="$scoped_dir/phar" add_tool "$fallback_url" "$tool" "$fallback_version_parameter"
|
||||
else
|
||||
add_tool "$fallback_url" "$tool" "$fallback_version_parameter"
|
||||
fi
|
||||
else
|
||||
add_log "$cross" "$tool" "Could not setup $tool"
|
||||
fi
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
add_bazel() {
|
||||
if ! command -v bazel; then
|
||||
if [ "$(uname -s)" = "Linux" ]; then
|
||||
add_list bazel/apt https://storage.googleapis.com/bazel-apt https://bazel.build/bazel-release.pub.gpg stable jdk1.8
|
||||
add_list bazel/apt https://storage.googleapis.com/bazel-apt https://releases.bazel.build/bazel-release.pub.gpg stable jdk1.8
|
||||
install_packages bazel
|
||||
else
|
||||
safe_brew install bazel
|
||||
|
||||
+312
-105
@@ -37,35 +37,45 @@ set_base_version() {
|
||||
|
||||
# Helper function to update package lists.
|
||||
update_lists_helper() {
|
||||
list=$1
|
||||
local list=$1
|
||||
command -v sudo >/dev/null && SUDO=sudo
|
||||
if [[ -n "$list" ]]; then
|
||||
${SUDO} apt-get update -o Dir::Etc::sourcelist="$list" -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0"
|
||||
${SUDO} apt-get update -o Dir::Etc::sourcelist="$list" -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0" "${@:2}"
|
||||
else
|
||||
${SUDO} apt-get update
|
||||
fi
|
||||
}
|
||||
|
||||
# Search active APT files, including symlinks, without descending into directories.
|
||||
grep_sources() (
|
||||
shopt -s nullglob
|
||||
local files=("$list_dir"/*.list "$list_dir"/*.sources)
|
||||
(( ${#files[@]} )) && grep -d skip -D skip "$@" -- "${files[@]}"
|
||||
)
|
||||
|
||||
# Function to update the package lists.
|
||||
update_lists() {
|
||||
local ppa=${1:-}
|
||||
local ppa_search=${2:-}
|
||||
local status_token=${3:-$ppa_search}
|
||||
local list=
|
||||
local status_file=/tmp/os_lists
|
||||
local hash_cmd
|
||||
if [[ -n "$ppa" && -n "$ppa_search" ]]; then
|
||||
if [ -f "$ppa_search" ]; then
|
||||
list="$ppa_search"
|
||||
else
|
||||
list="$(grep -Elr "$ppa_search" "$list_dir" 2>/dev/null | head -n 1)"
|
||||
fi
|
||||
hash_cmd="$(command -v sha256sum || command -v shasum)"
|
||||
if [ -n "$status_token" ] && [ -n "$hash_cmd" ]; then
|
||||
status_file=/tmp/os_lists_"$(echo -n "$status_token" | $hash_cmd | awk '{print $1}')"
|
||||
elif [ -n "$status_token" ]; then
|
||||
status_file=/tmp/os_lists_$(date +%s)
|
||||
list="$(grep_sources -El -e "$ppa_search" 2>/dev/null | head -n 1)"
|
||||
fi
|
||||
[ -n "$list" ] || return 1
|
||||
status_file="/tmp/os_lists_refresh_${list##*/}"
|
||||
[[ "${runner:-}" != self-hosted ]] && cmp -s "$list" "$status_file" && return 0
|
||||
local output rc
|
||||
output=$(LC_ALL=C update_lists_helper "$list" -o APT::Update::Error-Mode=any 2>&1) || {
|
||||
rc=$?
|
||||
[[ "${3:-}" = --on-missing-key && "$output" =~ $missing_key ]] || return "$rc"
|
||||
"$4" "$ppa" "$list" "${BASH_REMATCH[2]}" || return 1
|
||||
}
|
||||
[[ "${runner:-}" = self-hosted ]] || cp "$list" "$status_file"
|
||||
return
|
||||
elif [ -e "$list_file" ] && grep -Eq '^deb |^Types: *deb' "$list_file"; then
|
||||
list="$list_file"
|
||||
fi
|
||||
@@ -156,7 +166,7 @@ ubuntu_fingerprint() {
|
||||
ppa_uri="~${ppa%/*}/+archive/ubuntu/${ppa##*/}"
|
||||
get -s -n "" "${lp_api[0]}/$ppa_uri" | jq -er '.signing_key_fingerprint' 2>/dev/null \
|
||||
|| get -s -n "" "${lp_api[1]}/$ppa_uri" | jq -er '.signing_key_fingerprint' 2>/dev/null \
|
||||
|| get -s -n "" "$ppa_sp/keys/$ppa.fingerprint"
|
||||
|| { [ -n "${4:-}" ] && get -s -n "" "${4%.gpg}.fingerprint"; }
|
||||
}
|
||||
|
||||
|
||||
@@ -170,25 +180,48 @@ debian_fingerprint() {
|
||||
gpg --list-packets "$release_pub" | grep -Eo 'fpr\sv4\s.*[a-zA-Z0-9]+' | head -n 1 | cut -d ' ' -f 3
|
||||
}
|
||||
|
||||
# Check for a binary OpenPGP public keyring readable by APT.
|
||||
is_gpg_keyring() {
|
||||
local keys
|
||||
[ -s "$1" ] && LC_ALL=C file -Lb -- "$1" | grep -Eiq '^(OpenPGP public key|PGP(/GPG)? (public key|key public ring))' || return 1
|
||||
keys=$(gpg --batch --with-colons --show-keys "$1" 2>/dev/null) || return 1
|
||||
[[ -z "${2:-}" ]] || awk -F: -v signer="$2" '$1 == "fpr" && $10 ~ (signer "$") {found=1} END {exit !found}' <<< "$keys"
|
||||
}
|
||||
|
||||
# Function to add a GPG key.
|
||||
add_key() {
|
||||
ppa=${1:-ondrej/php}
|
||||
ppa_url=$2
|
||||
package_dist=$3
|
||||
key_source=$4
|
||||
key_file=$5
|
||||
key_urls=("$key_source")
|
||||
if [[ "$key_source" =~ launchpadcontent.net|debian.org ]]; then
|
||||
fingerprint="$("${ID}"_fingerprint "$ppa" "$ppa_url" "$package_dist")"
|
||||
add_key() (
|
||||
local ppa=$1 ppa_url=$2 package_dist=$3 key_source=$4 key_file=$5
|
||||
local mirror=${6:-} signer=${7:-} fingerprint sks_params
|
||||
local key_urls=("$key_source")
|
||||
if [[ -z "$key_source" || "$key_source" = "$ppa_url" ]]; then
|
||||
key_urls=()
|
||||
if fingerprint="$("${ID}"_fingerprint "$ppa" "$ppa_url" "$package_dist" "$mirror")" && [[ "$fingerprint" =~ ^[[:xdigit:]]+$ ]]; then
|
||||
sks_params="op=get&options=mr&exact=on&search=0x$fingerprint"
|
||||
key_urls=("${sks[@]/%/\/pks\/lookup\?"$sks_params"}")
|
||||
fi
|
||||
key_urls+=("$ppa_sp/keys/$ppa.gpg")
|
||||
[ ! -e "$key_source" ] && get -q -n "$key_file" "${key_urls[@]}"
|
||||
if [[ "$(file "$key_file")" =~ .*('Public-Key (old)'|'Secret-Key') ]]; then
|
||||
sudo gpg --batch --yes --dearmor "$key_file" >/dev/null 2>&1 && sudo mv "$key_file".gpg "$key_file"
|
||||
fi
|
||||
}
|
||||
[ -z "$mirror" ] || key_urls+=("$mirror")
|
||||
local stage url input pending=
|
||||
stage="$(mktemp -d)" || return 1
|
||||
trap 'rm -rf "$stage"; if [ -n "$pending" ]; then sudo rm -f -- "$pending"; fi' EXIT
|
||||
for url in "${key_urls[@]}"; do
|
||||
input=$url
|
||||
if [ ! -f "$input" ]; then
|
||||
input="$stage/download"
|
||||
: > "$input"
|
||||
(get -q -n "$input" "$url") || continue
|
||||
fi
|
||||
gpg --batch --yes --dearmor --output "$stage/key.gpg" "$input" >/dev/null 2>&1 || continue
|
||||
is_gpg_keyring "$stage/key.gpg" "$signer" || continue
|
||||
if [[ "$input" -ef "$key_file" ]] && { [[ "$key_file" = *.asc ]] || cmp -s "$input" "$stage/key.gpg"; }; then
|
||||
return 0
|
||||
fi
|
||||
pending="$(sudo mktemp "$key_file.XXXXXXXX")" || return 1
|
||||
sudo install -m 644 "$stage/key.gpg" "$pending" && sudo mv -f -- "$pending" "$key_file"
|
||||
return
|
||||
done
|
||||
return 1
|
||||
)
|
||||
|
||||
# Function to handle existing list files.
|
||||
handle_existing_list() {
|
||||
@@ -200,10 +233,10 @@ handle_existing_list() {
|
||||
echo "Repository $ppa ($branches) already exists" && return 1
|
||||
fi
|
||||
if merged_components="$(merge_components_from_file "$check_lists_file" "$branches")"; then
|
||||
sudo rm -f "$check_lists_file" && printf '%s\n' "$merged_components" && return 0
|
||||
printf '%s\n' "$merged_components" && return 0
|
||||
fi
|
||||
if [[ "$list_format" = "deb822" && "$check_lists_file" = *.list ]]; then
|
||||
sudo rm -f "$check_lists_file" && printf '%s\n' "$branches" && return 0
|
||||
printf '%s\n' "$branches" && return 0
|
||||
fi
|
||||
echo "Repository $ppa ($branches) already exists" && return 1
|
||||
}
|
||||
@@ -217,48 +250,43 @@ write_list() {
|
||||
local components=$5
|
||||
local key_file=$6
|
||||
local list_basename="${ppa%%/*}"-"$ID"-"${ppa#*/}"-"$suite"
|
||||
local arch
|
||||
local arch list dest by_hash=
|
||||
arch="$(dpkg --print-architecture)"
|
||||
sudo rm -f "$list_dir"/"${ppa/\//-}".list "$list_dir"/"${ppa/\//-}".sources "$list_dir"/"$list_basename".list "$list_dir"/"$list_basename".sources || true
|
||||
case "${url%/}" in
|
||||
"$ppa_sp/sury"|"$ppa_sp/apache2") by_hash=' by-hash=force' ;;
|
||||
esac
|
||||
dest="$list_dir/$list_basename.$(get_sources_extension "$type")"
|
||||
for list in "$list_dir/${ppa/\//-}".{list,sources} "$list_dir/$list_basename".{list,sources}; do
|
||||
[[ "$list" = "$dest" ]] || remove_list_entry "$list" "$url" || return 1
|
||||
done
|
||||
preserve_list "$dest" "$url" || return 1
|
||||
if [ "$type" = "deb822" ]; then
|
||||
cat <<EOF | sudo tee "$list_dir"/"$list_basename".sources >/dev/null
|
||||
Types: deb
|
||||
URIs: $url
|
||||
Suites: $suite
|
||||
Components: $components
|
||||
Architectures: $arch
|
||||
Signed-By: $key_file
|
||||
EOF
|
||||
{
|
||||
printf '%s\n' "Types: deb" "URIs: $url" "Suites: $suite" "Components: $components" "Architectures: $arch" "Signed-By: $key_file"
|
||||
if [ -n "$by_hash" ]; then printf '%s\n' 'By-Hash: force'; fi
|
||||
} | sudo tee "$dest" >/dev/null
|
||||
else
|
||||
echo "deb [arch=$arch signed-by=$key_file] $url $suite $components" | sudo tee "$list_dir"/"$list_basename".list >/dev/null 2>&1
|
||||
echo "deb [arch=$arch signed-by=$key_file$by_hash] $url $suite $components" | sudo tee "$dest" >/dev/null 2>&1
|
||||
fi
|
||||
}
|
||||
|
||||
# Function to check if a PPA and its lists exist
|
||||
check_lists() {
|
||||
local ppa=$1
|
||||
local primary=${2:-}
|
||||
local secondary=${3:-}
|
||||
local status_token=${4:-$primary}
|
||||
local pattern=${2:-${3:-}}
|
||||
local match_file=
|
||||
check_lists_file=
|
||||
if [ -n "$primary" ]; then
|
||||
match_file=$(grep -Elr "$primary" "$list_dir" 2>/dev/null | head -n 1)
|
||||
fi
|
||||
if [ -z "$match_file" ] && [ -n "$secondary" ]; then
|
||||
local candidate
|
||||
candidate=$(grep -Elr "$secondary" "$list_dir" 2>/dev/null | head -n 1)
|
||||
if [ -n "$candidate" ] && { [ -z "$primary" ] || grep -Eq "$primary" "$candidate"; }; then
|
||||
match_file="$candidate"
|
||||
fi
|
||||
if [ -n "$pattern" ]; then
|
||||
match_file=$(grep_sources -El -e "$pattern" 2>/dev/null | head -n 1)
|
||||
fi
|
||||
if [ -n "$match_file" ]; then
|
||||
check_lists_file="$match_file"
|
||||
[[ "${4:-}" != --lookup-only ]] || return 0
|
||||
local list_count
|
||||
list_count="$(sudo find /var/lib/apt/lists -type f -name "*${ppa/\//_}*" | wc -l)"
|
||||
if [ "$list_count" = "0" ]; then
|
||||
update_lists "$ppa" "$match_file" "$status_token"
|
||||
update_lists "$ppa" "$match_file"
|
||||
fi
|
||||
check_lists_file="$match_file"
|
||||
return 0
|
||||
fi
|
||||
return 1
|
||||
@@ -266,21 +294,19 @@ check_lists() {
|
||||
|
||||
# Function to add a sources list.
|
||||
add_list() {
|
||||
ppa=${1-ondrej/php}
|
||||
local ppa=${1-$default_ppa}
|
||||
ppa_url=${2:-"$lpc_ppa/$ppa/ubuntu"}
|
||||
key_source=${3:-"$ppa_url"}
|
||||
key_source=${3:-}
|
||||
package_dist=${4:-"$VERSION_CODENAME"}
|
||||
branches=${5:-main}
|
||||
local list_format
|
||||
local list_extension
|
||||
local status_token
|
||||
local resolved_branches
|
||||
local list_path=
|
||||
list_format="$(get_sources_format)"
|
||||
list_extension="$(get_sources_extension "$list_format")"
|
||||
status_token="${ppa_url}|${package_dist}|${branches}"
|
||||
IFS='|' read -r primary_pattern secondary_pattern <<< "$(get_repo_patterns "$list_format" "$ppa_url" "$package_dist" "$branches")"
|
||||
if check_lists "$ppa" "$primary_pattern" "$secondary_pattern" "$status_token"; then
|
||||
if check_lists "$ppa" "$primary_pattern" "$secondary_pattern" "${8:-}"; then
|
||||
list_path="$check_lists_file"
|
||||
if resolved_branches="$(handle_existing_list "$ppa" "$list_format" "$branches")"; then
|
||||
branches="$resolved_branches"
|
||||
@@ -288,14 +314,25 @@ add_list() {
|
||||
[ -n "$resolved_branches" ] && echo "$resolved_branches" && return 1
|
||||
fi
|
||||
check_lists_file=
|
||||
IFS='|' read -r primary_pattern secondary_pattern <<< "$(get_repo_patterns "$list_format" "$ppa_url" "$package_dist" "$branches")"
|
||||
status_token="${ppa_url}|${package_dist}|${branches}"
|
||||
fi
|
||||
[ -e "$key_source" ] && key_file=$key_source || key_file="$key_dir"/"${ppa/\//-}"-keyring.gpg
|
||||
add_key "$ppa" "$ppa_url" "$package_dist" "$key_source" "$key_file"
|
||||
write_list "$list_format" "$ppa" "$ppa_url" "$package_dist" "$branches" "$key_file"
|
||||
add_key "$ppa" "$ppa_url" "$package_dist" "$key_source" "$key_file" "${6:-}" || return 1
|
||||
[[ -z "$list_path" ]] || remove_list_entry "$list_path" "$ppa_url" || return 1
|
||||
write_list "$list_format" "$ppa" "$ppa_url" "$package_dist" "$branches" "$key_file" || return 1
|
||||
list_path="$list_dir"/"${ppa%%/*}"-"$ID"-"${ppa#*/}"-"$package_dist"."$list_extension"
|
||||
update_lists "$ppa" "$list_path" "$status_token"
|
||||
# A caller requesting an index needs a successful refresh, even if APT has cached lists.
|
||||
if [ -n "${7:-}" ]; then
|
||||
update_lists_helper "$list_path" -o APT::Update::Error-Mode=any || return 1
|
||||
local index indexes
|
||||
indexes=$(apt-get -o Dir::Etc::sourcelist="$list_path" -o Dir::Etc::sourceparts=- indextargets --format '$(FILENAME)' 'Identifier: Packages') || return 1
|
||||
while IFS= read -r index; do
|
||||
[ -s "$index" ] || continue
|
||||
printf '%s\n' "$index" > "$7"
|
||||
return
|
||||
done <<< "$indexes"
|
||||
return 1
|
||||
fi
|
||||
update_lists "$ppa" "$list_path"
|
||||
. /etc/os-release
|
||||
return 0;
|
||||
}
|
||||
@@ -309,66 +346,187 @@ check_ppa() {
|
||||
local list_format
|
||||
list_format="$(get_sources_format)"
|
||||
IFS='|' read -r primary_pattern secondary_pattern <<< "$(get_repo_patterns "$list_format" "$ppa_url" "$package_dist" "$branches")"
|
||||
local status_token
|
||||
status_token="${ppa_url}|${package_dist}|${branches}"
|
||||
if check_lists "$ppa" "$primary_pattern" "$secondary_pattern" "$status_token"; then
|
||||
return 0;
|
||||
check_lists "$ppa" "$primary_pattern" "$secondary_pattern" || return 1
|
||||
}
|
||||
|
||||
# Remove matching entries from one APT file and invalidate its cached refresh.
|
||||
remove_list_entry() {
|
||||
local list=$1 ppa_url=$2 uri filter
|
||||
[[ -f "$list" ]] && grep -Fq -- "${ppa_url%/}" "$list" || return 0
|
||||
uri=$(escape_regex "${ppa_url%/}")
|
||||
[[ "$ppa_url" != //* ]] || uri="https?:$uri"
|
||||
if [[ "$list" = *.sources ]]; then
|
||||
# Match URIs within one deb822 paragraph, including folded fields.
|
||||
local gap='([[:blank:]]|\r?\n(#[^\n]*\n)*[[:blank:]])'
|
||||
filter='/^[[:space:]]*$/b
|
||||
:stanza
|
||||
$!{N; /\n[[:blank:]]*\r?$/!b stanza;}
|
||||
/(^|\n)[Uu][Rr][Ii][Ss]:'"$gap*([^[:space:]]+$gap+)*$uri"'\/*([[:space:]]|$)/d'
|
||||
else
|
||||
return 1;
|
||||
filter="/^[[:blank:]]*deb(-src)?[[:blank:]]+(\\[[^]]*\\][[:blank:]]+)?$uri\\/*([[:space:]]|$)/d"
|
||||
fi
|
||||
sudo sed --follow-symlinks -Ei "$filter" "$list" || return 1
|
||||
grep -q '[^[:space:]]' "$list" || sudo rm -f -- "$list" || return 1
|
||||
sudo rm -f -- "/tmp/os_lists_refresh_${list##*/}" "${RUNNER_TEMP:-/tmp}/os_lists_${list##*/}" || return 1
|
||||
}
|
||||
|
||||
# Keep any other entries at an active sibling path before publishing a managed source.
|
||||
preserve_list() {
|
||||
local list=$1 url saved stamp="${RUNNER_TEMP:-/tmp}/os_lists_${1##*/}"
|
||||
[[ -e "$list" || -L "$list" ]] || return 0
|
||||
if [[ -f "$stamp" ]] && tail -n +4 "$stamp" | cmp -s - "$list"; then
|
||||
sudo rm -f -- "$list"
|
||||
return
|
||||
fi
|
||||
shift
|
||||
for url in "$@"; do remove_list_entry "$list" "$url" || return 1; done
|
||||
[[ -e "$list" || -L "$list" ]] || return 0
|
||||
saved=$(sudo mktemp --suffix=".${list##*.}" "${list%.*}.XXXXXXXX") && sudo mv -fT -- "$list" "$saved"
|
||||
}
|
||||
|
||||
# Function to remove a PPA.
|
||||
remove_list() {
|
||||
ppa=${1-ondrej/php}
|
||||
local ppa=${1-$default_ppa} list ppa_url
|
||||
local -a ppa_urls
|
||||
[ -n "$2" ] && ppa_urls=("$2") || ppa_urls=("$lp_ppa/$ppa/ubuntu" "$lpc_ppa/$ppa/ubuntu")
|
||||
for ppa_url in "${ppa_urls[@]}"; do
|
||||
grep -lr "$ppa_url" "$list_dir" | xargs -n1 sudo rm -f
|
||||
while IFS= read -r -d '' list; do
|
||||
remove_list_entry "$list" "$ppa_url" || return 1
|
||||
done < <(grep_sources -FlZ --exclude="${3:-}" -e "${ppa_url%/}")
|
||||
done
|
||||
sudo rm -f "$key_dir"/"${ppa/\//-}"-keyring /tmp/os_lists* || true
|
||||
[[ ! -e "$key_dir/${ppa/\//-}-keyring" ]] || sudo rm -f "$key_dir/${ppa/\//-}-keyring"
|
||||
}
|
||||
|
||||
# Function to check if ubuntu ppa is up
|
||||
is_ubuntu_ppa_up() {
|
||||
ppa=${1:-ondrej/php}
|
||||
ppa=${1:-$default_ppa}
|
||||
curl -s --connect-timeout 10 --max-time 10 --head --fail "$lpc_ppa/$ppa/ubuntu/dists/$VERSION_CODENAME/Release" > /dev/null
|
||||
}
|
||||
|
||||
# Function to add the PPA mirror.
|
||||
add_ppa_sp_mirror() {
|
||||
ppa=$1
|
||||
ppa_name="$(basename "$ppa")"
|
||||
remove_list "$ppa" || true
|
||||
[ "${debug:?}" = "debug" ] && add_list sp/"$ppa_name" "$ppa_sp/$ppa/ubuntu" "$ppa_sp/$ppa/ubuntu/key.gpg" "$VERSION_CODENAME" "main/debug"
|
||||
add_list sp/"$ppa_name" "$ppa_sp/$ppa/ubuntu" "$ppa_sp/$ppa/ubuntu/key.gpg"
|
||||
# Remove sources from caches that still have the old Launchpad mirrors.
|
||||
remove_legacy_mirrors() {
|
||||
local ppa old_ppa old_sp
|
||||
for ppa in ondrej/php ondrej/apache2; do
|
||||
old_ppa="//${ppa_sp#*://}/$ppa/ubuntu"
|
||||
old_sp="//${sp#*://}/$ppa/ubuntu"
|
||||
if grep_sources -Fq -e "$old_ppa" -e "$old_sp"; then
|
||||
remove_list "$ppa" "$old_ppa" && remove_list "$ppa" "$old_sp" || return 1
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
add_sury_list() {
|
||||
ppa=${1:-ondrej/php}
|
||||
[ "${debug:?}" = "debug" ] && add_list "$ppa" "$sury"/"${ppa##*/}"/ "$sury"/"${ppa##*/}"/apt.gpg "$VERSION_CODENAME" "main/debug"
|
||||
add_list "$ppa" "$sury"/"${ppa##*/}"/ "$sury"/"${ppa##*/}"/apt.gpg
|
||||
# Function to add the Sury mirror.
|
||||
add_ppa_sp_mirror() {
|
||||
local ppa=$1 name=${1##*/} url="$ppa_sp/sury"
|
||||
[[ "$ppa" =~ $mirrored_ppas ]] || return 1
|
||||
[ "$name" != apache2 ] || url="$ppa_sp/apache2"
|
||||
local key_mirror="$ppa_sp/keys/sury/$name.gpg"
|
||||
remove_list "$ppa" || true
|
||||
remove_legacy_mirrors || return 1
|
||||
[ "${debug:?}" = "debug" ] && add_list "sp/$name" "$url" "$url/apt.gpg" "$VERSION_CODENAME" "main/debug" "$key_mirror"
|
||||
add_list "sp/$name" "$url" "$url/apt.gpg" "$VERSION_CODENAME" main "$key_mirror"
|
||||
}
|
||||
|
||||
# Add a signed archive, using the mirror if APT cannot load a Packages index.
|
||||
# Arguments: [--keyring path primary-key-url mirror-key-url] list ID, primary URL, mirror URL, keyring, suite, components, optional source URLs to replace.
|
||||
add_list_with_fallback() (
|
||||
local managed_key='' key_url='' key_mirror=''
|
||||
if [[ "$1" = --keyring ]]; then
|
||||
managed_key=$2 key_url=$3 key_mirror=$4
|
||||
shift 4
|
||||
fi
|
||||
local ppa=$1 primary=$2 mirror=$3 key=$4 suite=${5:-$VERSION_CODENAME} components=${6:-main}
|
||||
local repo=${ppa_sources[$ID/$ppa]:-$ppa} source stamp request cached_request cached_key index
|
||||
local stage='' old_url
|
||||
[[ -s "$key" || -n "$managed_key" ]] || return 1
|
||||
sources_format="$(get_sources_format)"
|
||||
source="${repo%%/*}-$ID-${repo#*/}-$suite.$(get_sources_extension "$sources_format")"
|
||||
stamp="${RUNNER_TEMP:-/tmp}/os_lists_$source"
|
||||
printf -v request '%q ' "$primary" "$mirror" "$components" "${@:7}"
|
||||
if [[ -s "$list_dir/$source" && -s "$stamp" && ! "$key" -nt "$stamp" ]] &&
|
||||
[[ -n "$(find "$stamp" -mtime -1 -print)" ]] &&
|
||||
{ IFS= read -r cached_request && IFS= read -r index && IFS= read -r cached_key && cmp -s - "$list_dir/$source"; } < "$stamp" &&
|
||||
[[ "$cached_request" = "$request" && "$cached_key" = "$key" && -s "$index" ]] &&
|
||||
{ [[ "${require_mirror_by_hash:-}" != true ]] || ! grep -Fq "${mirror%/}" "$list_dir/$source" ||
|
||||
grep -Eq '^By-Hash: force$| by-hash=force( |])' "$list_dir/$source"; }; then
|
||||
# A cache can restore another source file after this archive was selected.
|
||||
(( $# > 6 )) && grep_sources -qF --exclude="$source" -f <(printf '%s\n' "${@:7}") || return 0
|
||||
else
|
||||
stage=$(mktemp -d /tmp/setup-php-list.XXXXXXXX) || return 1
|
||||
trap 'rm -rf "$stage"' EXIT
|
||||
chmod 755 "$stage" || return 1
|
||||
if [[ -z "$key" ]]; then
|
||||
key="$stage/initial.gpg"
|
||||
add_key "$repo" "$primary" "$suite" "$key_url" "$key" "$key_mirror" || return 1
|
||||
fi
|
||||
local url attempt_key output signer='' candidate="$stage/rotated.gpg"
|
||||
for url in "$primary" "$mirror"; do
|
||||
for attempt_key in "$key" "$candidate"; do
|
||||
if [[ "$attempt_key" = "$candidate" ]]; then
|
||||
[[ -n "$key_url" && "$output" =~ $missing_key ]] || break
|
||||
if [[ "$signer" != "${BASH_REMATCH[2]}" ]]; then
|
||||
signer=${BASH_REMATCH[2]}
|
||||
rm -f "$candidate" || return 1
|
||||
add_key "$repo" "$primary" "$suite" "$key_url" "$candidate" "$key_mirror" "$signer" || break
|
||||
fi
|
||||
[ -s "$candidate" ] || break
|
||||
rm -f "$stage/$source" || return 1
|
||||
fi
|
||||
if output=$(list_dir="$stage" add_list "$repo" "$url" "$attempt_key" "$suite" "$components" '' "$stage/index" 2>&1); then
|
||||
[[ -z "$output" ]] || printf '%s\n' "$output"
|
||||
key=$attempt_key
|
||||
break 2
|
||||
fi
|
||||
printf '%s\n' "$output" >&2
|
||||
done
|
||||
done
|
||||
[ -s "$stage/index" ] || return 1
|
||||
fi
|
||||
for old_url in "${@:7}"; do
|
||||
remove_list "$ppa" "$old_url" "$source" || return 1
|
||||
done
|
||||
[ -n "$stage" ] || return 0
|
||||
sudo rm -f "/tmp/os_lists_refresh_$source" || return 1
|
||||
if [[ "$key" = "$stage/"* ]]; then
|
||||
list_with_key "$stage/$source" "$managed_key" > "$stage/publish" && mv -f "$stage/publish" "$stage/$source" || return 1
|
||||
add_key "$repo" "$primary" "$suite" "$key" "$managed_key" || return 1
|
||||
key=$managed_key
|
||||
fi
|
||||
preserve_list "$list_dir/$source" "$primary" "$mirror" "${@:7}" || return 1
|
||||
sudo install -m 644 "$stage/$source" "$list_dir/$source" || return 1
|
||||
{ printf '%s\n' "$request" && cat "$stage/index" && printf '%s\n' "$key" && cat "$stage/$source"; } > "$stage/stamp" && mv -fT "$stage/stamp" "$stamp"
|
||||
)
|
||||
|
||||
# Function to add a PPA.
|
||||
add_ppa() {
|
||||
set_base_version
|
||||
ppa=${1:-ondrej/php}
|
||||
if [[ "$ID" = "ubuntu" || "$ID_LIKE" =~ ubuntu ]] && [[ "$ppa" =~ "ondrej/" ]]; then
|
||||
if [ "$VERSION_ID" = "26.04" ]; then
|
||||
add_sury_list
|
||||
ppa=${1:-$default_ppa}
|
||||
if [[ "$ID ${ID_LIKE:-}" =~ ubuntu|debian && "$ppa" =~ $mirrored_ppas ]]; then
|
||||
remove_legacy_mirrors || return 1
|
||||
local components=main name=${ppa##*/} primary="$sury/${ppa##*/}/" key_mirror="$ppa_sp/keys/sury/${ppa##*/}.gpg"
|
||||
if [[ "$name" = php && "$ID ${ID_LIKE:-}" != *ubuntu* ]]; then
|
||||
[ "${debug:?}" != debug ] || components="main/debug main"
|
||||
add_list "$ppa" "$primary" "${primary}apt.gpg" "$VERSION_CODENAME" "$components" "$key_mirror" '' --lookup-only ||
|
||||
{ [ -n "$check_lists_file" ] && update_lists "$ppa" "$check_lists_file" --on-missing-key retry_sury_update; }
|
||||
else
|
||||
if is_ubuntu_ppa_up "$ppa" ; then
|
||||
[ "${runner:?}" = "self-hosted" ] && find "$list_dir" -type f -name 'sp*' -exec grep -qF "${sp/https:\/\/}" {} \; -delete
|
||||
[ "${debug:?}" = "debug" ] && add_list "$ppa" "$lpc_ppa/$ppa/ubuntu" "$lpc_ppa/$ppa/ubuntu" "$VERSION_CODENAME" "main/debug"
|
||||
add_list "$ppa"
|
||||
elif [ "$ppa" = "ondrej/php" ]; then
|
||||
add_ppa_sp_mirror "$ppa"
|
||||
else
|
||||
add_log "${cross:?}" "$ppa" "PPA $ppa is not available"
|
||||
local mirror="$ppa_sp/sury/" managed_key="$key_dir/sury-$name-keyring.gpg" key=
|
||||
local -a curl_opts=("${curl_opts[@]}" --connect-timeout 5 --max-time 15)
|
||||
if [ "$name" = apache2 ]; then
|
||||
mirror="$ppa_sp/apache2/"
|
||||
[ "${debug:-}" != debug ] || components="main/debug main"
|
||||
fi
|
||||
local require_mirror_by_hash=true
|
||||
local -a options=("$VERSION_CODENAME" "$components" "//${lp_ppa#*://}/$ppa/ubuntu" "//${lpc_ppa#*://}/$ppa/ubuntu"
|
||||
"${primary%/}" "${mirror%/}")
|
||||
[ "$name" != php ] || options+=(mirror+file:/etc/apt/setup-php-sury-mirrors.txt)
|
||||
local packaged_key="$key_dir/debsuryorg-archive-keyring.gpg"
|
||||
if is_gpg_keyring "$managed_key"; then
|
||||
key="$managed_key"
|
||||
elif is_gpg_keyring "$packaged_key"; then
|
||||
key="$packaged_key"
|
||||
fi
|
||||
LC_ALL=C add_list_with_fallback --keyring "$managed_key" "${primary}apt.gpg" "$key_mirror" "$ppa" "$primary" "$mirror" "$key" "${options[@]}"
|
||||
fi
|
||||
elif [[ "$ID" = "debian" || "$ID_LIKE" =~ debian ]] && [[ "$ppa" =~ "ondrej/" ]]; then
|
||||
add_sury_list
|
||||
else
|
||||
add_list "$ppa"
|
||||
fi
|
||||
@@ -377,25 +535,70 @@ add_ppa() {
|
||||
return $exit_code
|
||||
}
|
||||
|
||||
# Replace a single Signed-By keyring, preserving the rest of a deb or deb822 source.
|
||||
list_with_key() {
|
||||
awk -v key="$2" '
|
||||
/^Signed-By:[[:blank:]]+\/[^[:space:]]+$/ { $0 = "Signed-By: " key; changed = 1 }
|
||||
/^deb(-src)?[[:blank:]]/ && match($0, /[[:blank:][]signed-by=\/[^],[:space:]]+[][:blank:]]/) {
|
||||
$0 = substr($0, 1, RSTART) "signed-by=" key substr($0, RSTART + RLENGTH - 1)
|
||||
changed = 1
|
||||
}
|
||||
{ print }
|
||||
END { exit !changed }
|
||||
' "$1"
|
||||
}
|
||||
|
||||
# Retry just the selected Sury source after APT reports a missing signer.
|
||||
retry_sury_update() (
|
||||
local ppa=$1 list=$2 signer=$3 name=${1##*/} selected stage
|
||||
[[ "$ppa" =~ $mirrored_ppas ]] || return 1
|
||||
local primary="$sury/$name/" mirror="$ppa_sp/sury/" key="$key_dir/sury-$name-keyring.gpg"
|
||||
[ "$name" != apache2 ] || mirror="$ppa_sp/apache2/"
|
||||
selected=$(apt-get -o Dir::Etc::sourcelist="$list" -o Dir::Etc::sourceparts=- indextargets \
|
||||
--no-release-info --format '$(REPO_URI)' | sort -u) || return 1
|
||||
[[ "${selected%/}" = "${primary%/}" || "${selected%/}" = "${mirror%/}" ]] || return 1
|
||||
|
||||
local source=${list##*/} request index old_key
|
||||
local stamp="${RUNNER_TEMP:-/tmp}/os_lists_$source"
|
||||
local -a curl_opts=("${curl_opts[@]}" --connect-timeout 5 --max-time 15)
|
||||
stage=$(mktemp -d /tmp/setup-php-key.XXXXXXXX) || return 1
|
||||
trap 'if (( $? != 0 )); then rm -f -- "$stamp"; fi; rm -rf "$stage"' EXIT
|
||||
# APT's signature verifier runs as an unprivileged user.
|
||||
chmod 755 "$stage" || return 1
|
||||
list_with_key "$list" "$stage/key.gpg" > "$stage/$source" || return 1
|
||||
add_key "sury/$name" "$primary" "$VERSION_CODENAME" "${primary}apt.gpg" "$stage/key.gpg" "$ppa_sp/keys/sury/$name.gpg" "$signer" || return 1
|
||||
update_lists_helper "$stage/$source" -o APT::Update::Error-Mode=any || return 1
|
||||
|
||||
list_with_key "$list" "$key" > "$stage/$source" || return 1
|
||||
add_key "sury/$name" "$primary" "$VERSION_CODENAME" "$stage/key.gpg" "$key" || return 1
|
||||
if [[ -s "$stamp" ]] && { IFS= read -r request && IFS= read -r index && IFS= read -r old_key && [[ -n "$old_key" ]] && cmp -s - "$list"; } < "$stamp"; then
|
||||
{ printf '%s\n' "$request" "$index" "$key" && cat "$stage/$source"; } > "$stage/stamp" || return 1
|
||||
fi
|
||||
sudo install -m 644 "$stage/$source" "$list" || return 1
|
||||
[[ ! -f "$stage/stamp" ]] || mv -fT "$stage/stamp" "$stamp"
|
||||
)
|
||||
|
||||
# Function to update a PPA.
|
||||
update_ppa() {
|
||||
set_base_version
|
||||
ppa=${1:-ondrej/php}
|
||||
ppa=${1:-$default_ppa}
|
||||
ppa_url=${2:-"$lpc_ppa/$ppa/ubuntu"}
|
||||
package_dist=${4:-"$VERSION_CODENAME"}
|
||||
branches=${5:-main}
|
||||
local list_format
|
||||
list_format="$(get_sources_format)"
|
||||
IFS='|' read -r primary_pattern secondary_pattern <<< "$(get_repo_patterns "$list_format" "$ppa_url" "$package_dist" "$branches")"
|
||||
local repo=${ppa_sources[$ID/$ppa]:-$ppa}
|
||||
local list_path
|
||||
list_path="$(grep -Elr "$primary_pattern" "$list_dir" 2>/dev/null | head -n 1)"
|
||||
if [ -z "$list_path" ] && [ -n "$secondary_pattern" ]; then
|
||||
list_path="$(grep -Elr "$secondary_pattern" "$list_dir" 2>/dev/null | head -n 1)"
|
||||
list_path="$list_dir/${repo%%/*}-$ID-${repo#*/}-$package_dist.$(get_sources_extension "$list_format")"
|
||||
if [[ -n "${2:-}" || ! -s "$list_path" ]]; then
|
||||
IFS='|' read -r primary_pattern secondary_pattern <<< "$(get_repo_patterns "$list_format" "$ppa_url" "$package_dist" "$branches")"
|
||||
list_path="$(grep_sources -El -e "$primary_pattern" 2>/dev/null | head -n 1)"
|
||||
[ -n "$list_path" ] || return 1
|
||||
fi
|
||||
local status_token
|
||||
status_token="${ppa_url}|${package_dist}|${branches}"
|
||||
update_lists "$ppa" "${list_path:-$primary_pattern}" "$status_token"
|
||||
local rc=0
|
||||
update_lists "$ppa" "$list_path" --on-missing-key retry_sury_update || rc=$?
|
||||
. /etc/os-release
|
||||
return "$rc"
|
||||
}
|
||||
|
||||
# Variables
|
||||
@@ -416,6 +619,10 @@ dist_info_dir='/usr/share/distro-info'
|
||||
sury='https://packages.sury.org'
|
||||
ppa_sp='https://ppa.setup-php.com'
|
||||
sp='https://setup-php.com'
|
||||
default_ppa='ondrej/php'
|
||||
missing_key='(NO_PUBKEY|Missing key) ([[:xdigit:]]{16,64})'
|
||||
mirrored_ppas='^ondrej/(apache2|php)$'
|
||||
declare -A ppa_sources=([ubuntu/ondrej/php]=setup-php/sury [ubuntu/ondrej/apache2]=setup-php/sury-apache2 [debian/ondrej/apache2]=setup-php/sury-apache2)
|
||||
sks=(
|
||||
'https://keyserver.ubuntu.com'
|
||||
'https://pgp.mit.edu'
|
||||
|
||||
+15
-1
@@ -7,6 +7,7 @@ export jit_versions="8.[0-9]"
|
||||
export php_builder_versions="8.[3-9]"
|
||||
export nightly_versions="8.[7-9]"
|
||||
export xdebug3_versions="7.[2-4]|8.[0-9]"
|
||||
export no_asan_builds="5.[3-6]|7.[0-4]"
|
||||
export latest="releases/latest/download"
|
||||
export github="https://github.com/shivammathur"
|
||||
export jsdeliver="https://cdn.jsdelivr.net/gh/shivammathur"
|
||||
@@ -76,16 +77,27 @@ check_builds_cache_runner() {
|
||||
return 1
|
||||
}
|
||||
|
||||
# Function to configure environment for ASAN builds.
|
||||
configure_asan() {
|
||||
use_builds_cache=false
|
||||
update=true
|
||||
add_env ASAN_OPTIONS "${ASAN_OPTIONS:-detect_leaks=0}"
|
||||
add_env UBSAN_OPTIONS "${UBSAN_OPTIONS:-halt_on_error=1}"
|
||||
add_env ZEND_DONT_UNLOAD_MODULES "${ZEND_DONT_UNLOAD_MODULES:-1}"
|
||||
add_env USE_ZEND_ALLOC "${USE_ZEND_ALLOC:-0}"
|
||||
}
|
||||
|
||||
# Function to read env inputs.
|
||||
read_env() {
|
||||
if [[ "${SETUP_PHP_TRACE:-0}" =~ ^[12]$ ]]; then
|
||||
set -x
|
||||
fi
|
||||
update="${update:-${UPDATE:-false}}"
|
||||
use_builds_cache="${use_builds_cache:-${use_package_cache:-}}"
|
||||
[ "${debug:-${DEBUG:-false}}" = "true" ] && debug=debug && update=true || debug=release
|
||||
[[ "${phpts:-${PHPTS:-nts}}" = "ts" || "${phpts:-${PHPTS:-nts}}" = "zts" ]] && ts=zts && update=true || ts=nts
|
||||
[[ "$OSTYPE" = linux* && "${asan:-${ASAN:-false}}" = "true" ]] && asan=asan && configure_asan || asan=
|
||||
fail_fast="${fail_fast:-${FAIL_FAST:-false}}"
|
||||
use_builds_cache="${use_builds_cache:-${use_package_cache:-}}"
|
||||
[[ ( -z "$ImageOS" && -z "$ImageVersion" ) ||
|
||||
( -n "$RUNNER_ENVIRONMENT" && "$RUNNER_ENVIRONMENT" = "self-hosted" ) ||
|
||||
-n "$ACT" || -n "$CONTAINER" ]] && _runner=self-hosted || _runner=github
|
||||
@@ -95,6 +107,7 @@ read_env() {
|
||||
if [[ "${ID:-}" = "ubuntu" && -z "$ACT" && -z "$CONTAINER" &&
|
||||
( -n "${BLACKSMITH_VM_ID:-}" || "${RUNNER_NAME:-}" =~ ^(blacksmith|depot|nsc-runner)- ) ]] && check_builds_cache_runner; then
|
||||
_runner=github
|
||||
# shellcheck disable=SC2034
|
||||
builds_cache_warning=true
|
||||
fi
|
||||
fi
|
||||
@@ -120,6 +133,7 @@ read_env() {
|
||||
export runner
|
||||
export update
|
||||
export ts
|
||||
export asan
|
||||
export tool_path_dir
|
||||
export tool_cache_path_dir
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user