diff options
author | Hans de Graaff <graaff@gentoo.org> | 2023-09-16 09:04:48 +0200 |
---|---|---|
committer | Hans de Graaff <graaff@gentoo.org> | 2023-09-16 09:05:32 +0200 |
commit | ab9cd7f7b81120efc3d8573e6517450f4696475a (patch) | |
tree | 936bce1bfdc6070e8764d7b3407a7e9779e5332b /dev-ruby/mechanize | |
parent | dev-dotnet/dotnet-runtime-nugets: Keyword 7.0.5 arm, #914249 (diff) | |
download | gentoo-ab9cd7f7b81120efc3d8573e6517450f4696475a.tar.gz gentoo-ab9cd7f7b81120efc3d8573e6517450f4696475a.tar.bz2 gentoo-ab9cd7f7b81120efc3d8573e6517450f4696475a.zip |
dev-ruby/mechanize/files: add missing patches
Closes: https://bugs.gentoo.org/914264
Signed-off-by: Hans de Graaff <graaff@gentoo.org>
Diffstat (limited to 'dev-ruby/mechanize')
-rw-r--r-- | dev-ruby/mechanize/files/mechanize-2.9.1-libxml2-1.patch | 64 | ||||
-rw-r--r-- | dev-ruby/mechanize/files/mechanize-2.9.1-libxml2-2.patch | 34 |
2 files changed, 98 insertions, 0 deletions
diff --git a/dev-ruby/mechanize/files/mechanize-2.9.1-libxml2-1.patch b/dev-ruby/mechanize/files/mechanize-2.9.1-libxml2-1.patch new file mode 100644 index 000000000000..e2b72f2d8adf --- /dev/null +++ b/dev-ruby/mechanize/files/mechanize-2.9.1-libxml2-1.patch @@ -0,0 +1,64 @@ +From 762df0c71705d1c054aca4abd95a638774a47242 Mon Sep 17 00:00:00 2001 +From: Mike Dalessio <mike.dalessio@gmail.com> +Date: Wed, 7 Jun 2023 10:30:37 -0400 +Subject: [PATCH] test: work around libxml2 encoding changes + +versions 2.11.0..2.11.4 do not recover from encoding errors. upcoming +release will change the encoding of the resulting doc as a result of +recovery changes in libxml2. + +See https://gitlab.gnome.org/GNOME/libxml2/-/issues/543 for more +context. +--- + test/test_mechanize_page_link.rb | 14 ++++++++++++-- + 1 file changed, 12 insertions(+), 2 deletions(-) + +diff --git a/test/test_mechanize_page_link.rb b/test/test_mechanize_page_link.rb +index 5e77dcc0..988328cc 100644 +--- a/test/test_mechanize_page_link.rb ++++ b/test/test_mechanize_page_link.rb +@@ -1,5 +1,7 @@ + # coding: utf-8 + ++puts "Nokogiri::VERSION_INFO: #{Nokogiri::VERSION_INFO}" ++ + require 'mechanize/test_case' + + class TestMechanizePageLink < Mechanize::TestCase +@@ -111,11 +113,15 @@ def test_encoding_charset_after_title + def test_encoding_charset_after_title_bad + skip_if_nkf_dependency + ++ # https://gitlab.gnome.org/GNOME/libxml2/-/issues/543 ++ skip if Nokogiri.uses_libxml?([">= 2.11.0", "<= 2.11.4"]) ++ expected_encoding = Nokogiri.uses_libxml?("< 2.11.0") ? 'UTF-8' : 'Shift_JIS' ++ + page = util_page UTF8 + + assert_equal false, page.encoding_error? + +- assert_equal 'UTF-8', page.encoding ++ assert_equal expected_encoding, page.encoding + end + + def test_encoding_charset_after_title_double_bad +@@ -131,6 +137,10 @@ def test_encoding_charset_after_title_double_bad + def test_encoding_charset_bad + skip_if_nkf_dependency + ++ # https://gitlab.gnome.org/GNOME/libxml2/-/issues/543 ++ skip if Nokogiri.uses_libxml?([">= 2.11.0", "<= 2.11.4"]) ++ expected_encoding = Nokogiri.uses_libxml?("< 2.11.0") ? 'UTF-8' : 'Shift_JIS' ++ + page = util_page "<title>#{UTF8_TITLE}</title>" + page.encodings.replace %w[ + UTF-8 +@@ -139,7 +149,7 @@ def test_encoding_charset_bad + + assert_equal false, page.encoding_error? + +- assert_equal 'UTF-8', page.encoding ++ assert_equal expected_encoding, page.encoding + end + + def test_encoding_meta_charset diff --git a/dev-ruby/mechanize/files/mechanize-2.9.1-libxml2-2.patch b/dev-ruby/mechanize/files/mechanize-2.9.1-libxml2-2.patch new file mode 100644 index 000000000000..3fcd8a270b16 --- /dev/null +++ b/dev-ruby/mechanize/files/mechanize-2.9.1-libxml2-2.patch @@ -0,0 +1,34 @@ +From 0ba09f46be6f1ce4adb94baca9867ed769f6535a Mon Sep 17 00:00:00 2001 +From: Mike Dalessio <mike.dalessio@gmail.com> +Date: Fri, 11 Aug 2023 09:29:06 -0400 +Subject: [PATCH] test: work around libxml2 encoding changes + +Related to 762df0c7, we're seeing the upstream fixes did not ship in +v2.11.5 so let's change the version test to assume it won't land until +v2.12.0. +--- + test/test_mechanize_page_link.rb | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/test/test_mechanize_page_link.rb b/test/test_mechanize_page_link.rb +index 988328cc..04294420 100644 +--- a/test/test_mechanize_page_link.rb ++++ b/test/test_mechanize_page_link.rb +@@ -114,7 +114,7 @@ def test_encoding_charset_after_title_bad + skip_if_nkf_dependency + + # https://gitlab.gnome.org/GNOME/libxml2/-/issues/543 +- skip if Nokogiri.uses_libxml?([">= 2.11.0", "<= 2.11.4"]) ++ skip if Nokogiri.uses_libxml?([">= 2.11.0", "< 2.12.0"]) + expected_encoding = Nokogiri.uses_libxml?("< 2.11.0") ? 'UTF-8' : 'Shift_JIS' + + page = util_page UTF8 +@@ -138,7 +138,7 @@ def test_encoding_charset_bad + skip_if_nkf_dependency + + # https://gitlab.gnome.org/GNOME/libxml2/-/issues/543 +- skip if Nokogiri.uses_libxml?([">= 2.11.0", "<= 2.11.4"]) ++ skip if Nokogiri.uses_libxml?([">= 2.11.0", "< 2.12.0"]) + expected_encoding = Nokogiri.uses_libxml?("< 2.11.0") ? 'UTF-8' : 'Shift_JIS' + + page = util_page "<title>#{UTF8_TITLE}</title>" |