From bd1620cd9edf6e1c43bd732fe461945203017f4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Fri, 30 Aug 2024 11:44:58 +0200 Subject: [PATCH] Remove support for <1.0 versions of brotli --- ...support-for-older-versions-of-brotli.patch | 29 ------------------- 1 file changed, 29 deletions(-) delete mode 100644 sources/patches/main-3-Re-add-support-for-older-versions-of-brotli.patch diff --git a/sources/patches/main-3-Re-add-support-for-older-versions-of-brotli.patch b/sources/patches/main-3-Re-add-support-for-older-versions-of-brotli.patch deleted file mode 100644 index 728758a..0000000 --- a/sources/patches/main-3-Re-add-support-for-older-versions-of-brotli.patch +++ /dev/null @@ -1,29 +0,0 @@ -diff --git a/lib/tasks/assets.rake b/lib/tasks/assets.rake -index 7b47f21658..ea6d0da2c4 100644 ---- a/lib/tasks/assets.rake -+++ b/lib/tasks/assets.rake -@@ -116,9 +116,21 @@ def gzip(path) - end - - # different brotli versions use different parameters --def brotli_command(path, max_compress) -- compression_quality = max_compress ? "11" : "6" -- "brotli -f --quality=#{compression_quality} #{path} --output=#{path}.br" -+ver_out, _ver_err, ver_status = Open3.capture3('brotli --version') -+if !ver_status.success? -+ # old versions of brotli don't respond to --version -+ def brotli_command(path, max_compress) -+ compression_quality = max_compress ? "11" : "6" -+ "brotli --quality 11 --input #{path} --output #{path}.br" -+ end -+elsif ver_out >= "brotli 1.0.0" -+ def brotli_command(path, max_compress) -+ compression_quality = max_compress ? "11" : "6" -+ "brotli -f --quality=11 #{path} --output=#{path}.br" -+ end -+else -+ # not sure what to do here, not expecting this -+ raise "cannot determine brotli version" - end - - def brotli(path, max_compress)