Fix pruned FFmpeg release inputs
Some checks failed
Some checks failed
This commit is contained in:
@@ -11,7 +11,7 @@ manifest_value() {
|
||||
"$manifest" "$1"
|
||||
}
|
||||
|
||||
for command in python3 curl sha256sum tar awk; do
|
||||
for command in python3 curl sha256sum tar awk wc; do
|
||||
command -v "$command" >/dev/null 2>&1 || {
|
||||
echo "required command was not found: $command" >&2
|
||||
exit 1
|
||||
@@ -21,6 +21,7 @@ done
|
||||
archive="$(manifest_value archive)"
|
||||
url="$(manifest_value url)"
|
||||
expected_hash="$(manifest_value sha256)"
|
||||
expected_size="$(manifest_value size)"
|
||||
expected_version="$(manifest_value ffmpeg_version)"
|
||||
archive_root="${archive%.tar.xz}"
|
||||
download_dir="$repo_root/build/downloads"
|
||||
@@ -29,9 +30,14 @@ sdk_root="$destination/$archive_root"
|
||||
|
||||
mkdir -p -- "$download_dir" "$destination"
|
||||
if [[ ! -f "$archive_path" ]]; then
|
||||
curl --fail --location --retry 3 --output "$archive_path" "$url"
|
||||
curl --fail --location --retry 3 --remove-on-error --output "$archive_path" "$url"
|
||||
fi
|
||||
|
||||
actual_size="$(wc -c < "$archive_path")"
|
||||
if [[ "$actual_size" != "$expected_size" ]]; then
|
||||
echo "FFmpeg archive size mismatch: expected $expected_size, got $actual_size" >&2
|
||||
exit 1
|
||||
fi
|
||||
actual_hash="$(sha256sum "$archive_path" | awk '{ print $1 }')"
|
||||
if [[ "$actual_hash" != "$expected_hash" ]]; then
|
||||
echo "FFmpeg archive SHA-256 mismatch: expected $expected_hash, got $actual_hash" >&2
|
||||
|
||||
@@ -10,11 +10,24 @@ if ([string]::IsNullOrWhiteSpace($Destination)) {
|
||||
$manifest = Get-Content -LiteralPath (Join-Path $PSScriptRoot 'dependency-win64.json') -Raw | ConvertFrom-Json
|
||||
$downloadDir = Join-Path $repoRoot 'build\downloads'
|
||||
$archivePath = Join-Path $downloadDir $manifest.archive
|
||||
$partialArchivePath = "$archivePath.part"
|
||||
$extractRoot = Join-Path $Destination ([IO.Path]::GetFileNameWithoutExtension($manifest.archive))
|
||||
New-Item -ItemType Directory -Force -Path $downloadDir | Out-Null
|
||||
|
||||
if (-not (Test-Path -LiteralPath $archivePath)) {
|
||||
Invoke-WebRequest -Uri $manifest.url -OutFile $archivePath
|
||||
try {
|
||||
Invoke-WebRequest -Uri $manifest.url -OutFile $partialArchivePath
|
||||
Move-Item -LiteralPath $partialArchivePath -Destination $archivePath
|
||||
}
|
||||
finally {
|
||||
if (Test-Path -LiteralPath $partialArchivePath) {
|
||||
Remove-Item -LiteralPath $partialArchivePath -Force
|
||||
}
|
||||
}
|
||||
}
|
||||
$actualSize = (Get-Item -LiteralPath $archivePath).Length
|
||||
if ($actualSize -ne $manifest.size) {
|
||||
throw "FFmpeg archive size mismatch: expected $($manifest.size), got $actualSize"
|
||||
}
|
||||
$actualHash = (Get-FileHash -Algorithm SHA256 -LiteralPath $archivePath).Hash.ToLowerInvariant()
|
||||
if ($actualHash -ne $manifest.sha256) {
|
||||
@@ -28,7 +41,7 @@ if (-not (Test-Path -LiteralPath (Join-Path $sdkRoot 'include\libavformat\avform
|
||||
throw "Pinned FFmpeg SDK was not found at $sdkRoot"
|
||||
}
|
||||
$reported = & (Join-Path $sdkRoot 'bin\ffmpeg.exe') -version | Select-Object -First 1
|
||||
$expectedVersion = $manifest.ffmpeg_version -replace '-20260721$', ''
|
||||
$expectedVersion = $manifest.ffmpeg_version -replace '-\d{8}$', ''
|
||||
if ($reported -notlike "*$expectedVersion*" ) {
|
||||
throw "Unexpected FFmpeg build: $reported"
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ manifest_value() {
|
||||
"$manifest" "$1"
|
||||
}
|
||||
|
||||
for command in python3 curl sha256sum awk; do
|
||||
for command in python3 curl sha256sum awk wc; do
|
||||
command -v "$command" >/dev/null 2>&1 || {
|
||||
echo "required command was not found: $command" >&2
|
||||
exit 1
|
||||
@@ -21,6 +21,7 @@ done
|
||||
archive="$(manifest_value archive)"
|
||||
url="$(manifest_value url)"
|
||||
expected_hash="$(manifest_value sha256)"
|
||||
expected_size="$(manifest_value size)"
|
||||
archive_root="${archive%.zip}"
|
||||
download_directory="$repo_root/build/downloads"
|
||||
archive_path="$download_directory/$archive"
|
||||
@@ -28,9 +29,14 @@ sdk_root="$destination/$archive_root"
|
||||
|
||||
mkdir -p -- "$download_directory" "$destination"
|
||||
if [[ ! -f "$archive_path" ]]; then
|
||||
curl --fail --location --retry 3 --output "$archive_path" "$url"
|
||||
curl --fail --location --retry 3 --remove-on-error --output "$archive_path" "$url"
|
||||
fi
|
||||
|
||||
actual_size="$(wc -c < "$archive_path")"
|
||||
if [[ "$actual_size" != "$expected_size" ]]; then
|
||||
echo "FFmpeg archive size mismatch: expected $expected_size, got $actual_size" >&2
|
||||
exit 1
|
||||
fi
|
||||
actual_hash="$(sha256sum "$archive_path" | awk '{ print $1 }')"
|
||||
if [[ "$actual_hash" != "$expected_hash" ]]; then
|
||||
echo "FFmpeg archive SHA-256 mismatch: expected $expected_hash, got $actual_hash" >&2
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
{
|
||||
"provider": "BtbN/FFmpeg-Builds",
|
||||
"release_tag": "autobuild-2026-07-21-13-38",
|
||||
"archive": "ffmpeg-n8.1.2-29-g703dcc25b9-linux64-lgpl-shared-8.1.tar.xz",
|
||||
"url": "https://github.com/BtbN/FFmpeg-Builds/releases/download/autobuild-2026-07-21-13-38/ffmpeg-n8.1.2-29-g703dcc25b9-linux64-lgpl-shared-8.1.tar.xz",
|
||||
"sha256": "d0026954f10d303d1fc6517ed6b2290c42323b3958f11baafb1b330dfc564b36",
|
||||
"ffmpeg_version": "n8.1.2-29-g703dcc25b9-20260721",
|
||||
"ffmpeg_commit": "703dcc25b9",
|
||||
"release_tag": "autobuild-2026-08-17-13-05",
|
||||
"archive": "ffmpeg-n8.1.2-44-g7c533d0f86-linux64-lgpl-shared-8.1.tar.xz",
|
||||
"url": "https://github.com/BtbN/FFmpeg-Builds/releases/download/autobuild-2026-08-17-13-05/ffmpeg-n8.1.2-44-g7c533d0f86-linux64-lgpl-shared-8.1.tar.xz",
|
||||
"size": 56931952,
|
||||
"sha256": "194dc8d525ac8cea5a5ff2e6fd44754747e69af5a766e7a6727cce363bd65de6",
|
||||
"ffmpeg_version": "n8.1.2-44-g7c533d0f86-20260817",
|
||||
"ffmpeg_commit": "7c533d0f86",
|
||||
"variant": "linux64 LGPL shared 8.1",
|
||||
"minimum_glibc": "2.28",
|
||||
"minimum_linux_kernel": "4.18"
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
{
|
||||
"provider": "BtbN/FFmpeg-Builds",
|
||||
"release_tag": "autobuild-2026-07-21-13-38",
|
||||
"archive": "ffmpeg-n8.1.2-29-g703dcc25b9-win64-lgpl-shared-8.1.zip",
|
||||
"url": "https://github.com/BtbN/FFmpeg-Builds/releases/download/autobuild-2026-07-21-13-38/ffmpeg-n8.1.2-29-g703dcc25b9-win64-lgpl-shared-8.1.zip",
|
||||
"sha256": "50764b52d38cb0baf8af938c0e4ca886d2c6753b520b2c319b532ed5c17e7cbf",
|
||||
"ffmpeg_version": "n8.1.2-29-g703dcc25b9-20260721",
|
||||
"ffmpeg_commit": "703dcc25b9",
|
||||
"release_tag": "autobuild-2026-08-17-13-05",
|
||||
"archive": "ffmpeg-n8.1.2-44-g7c533d0f86-win64-lgpl-shared-8.1.zip",
|
||||
"url": "https://github.com/BtbN/FFmpeg-Builds/releases/download/autobuild-2026-08-17-13-05/ffmpeg-n8.1.2-44-g7c533d0f86-win64-lgpl-shared-8.1.zip",
|
||||
"size": 70837934,
|
||||
"sha256": "681b9ca6d8f9be1e01d8873ad16f8a632f8a22b9653f1044837de6d5979b0fd6",
|
||||
"ffmpeg_version": "n8.1.2-44-g7c533d0f86-20260817",
|
||||
"ffmpeg_commit": "7c533d0f86",
|
||||
"variant": "win64 LGPL shared 8.1"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user