From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 65A0415800B for ; Wed, 5 Apr 2023 03:17:38 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id AAEC7E0849; Wed, 5 Apr 2023 03:17:37 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 6FD10E0855 for ; Wed, 5 Apr 2023 03:17:37 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 8E96B340D11 for ; Wed, 5 Apr 2023 03:17:36 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 4CA03A19 for ; Wed, 5 Apr 2023 03:17:34 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1680664567.09f1485536783ef9d2f7309ca29b899133162c43.sam@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: dev-ruby/mail/, dev-ruby/mail/files/ X-VCS-Repository: repo/gentoo X-VCS-Files: dev-ruby/mail/files/mail-2.7.1-psych-4.patch dev-ruby/mail/mail-2.7.1-r1.ebuild dev-ruby/mail/mail-2.7.1-r2.ebuild X-VCS-Directories: dev-ruby/mail/ dev-ruby/mail/files/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: 09f1485536783ef9d2f7309ca29b899133162c43 X-VCS-Branch: master Date: Wed, 5 Apr 2023 03:17:34 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 87b5c6aa-0e2e-4bc5-9008-0901dc0469c5 X-Archives-Hash: 0f14058a28cc119c2bb735581d2d27ea commit: 09f1485536783ef9d2f7309ca29b899133162c43 Author: Sam James gentoo org> AuthorDate: Wed Apr 5 02:05:30 2023 +0000 Commit: Sam James gentoo org> CommitDate: Wed Apr 5 03:16:07 2023 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=09f14855 dev-ruby/mail: fix 2.7.x compat w/ newer psych (+ enable ruby31, enable ruby32) mail-2.7.x is still needed for Rails. It turns out that this got broken by newer Psych so tests were failing for ruby27 too. Backport the upstream patch (actually, use Debian's backport, done for us) which is pretty conversative and just adds a shim for newer Psych to set the needed attributes. Closes: https://bugs.gentoo.org/835322 Signed-off-by: Sam James gentoo.org> dev-ruby/mail/files/mail-2.7.1-psych-4.patch | 122 +++++++++++++++++++++ dev-ruby/mail/mail-2.7.1-r1.ebuild | 4 +- .../{mail-2.7.1-r1.ebuild => mail-2.7.1-r2.ebuild} | 11 +- 3 files changed, 132 insertions(+), 5 deletions(-) diff --git a/dev-ruby/mail/files/mail-2.7.1-psych-4.patch b/dev-ruby/mail/files/mail-2.7.1-psych-4.patch new file mode 100644 index 000000000000..ea3dff47910e --- /dev/null +++ b/dev-ruby/mail/files/mail-2.7.1-psych-4.patch @@ -0,0 +1,122 @@ +https://bugs.gentoo.org/835322 + +https://github.com/mikel/mail/commit/a20fdd591bd5b1596983f5e1ee6ffed4e0b1f5f9 +https://sources.debian.org/patches/ruby-mail/2.7.1%2Bdfsg1-2/0001-Add-Mail-YAML-load-compatible-with-Psych-3.x-and-Psy.patch/ + +From: =?utf-8?b?Sm9zZWYgxaBpbcOhbmVr?= +Date: Sun, 4 Dec 2022 15:18:33 -0300 +Subject: Add Mail::YAML#load compatible with Psych 3.x and Psych 4.x. +MIME-Version: 1.0 +Content-Type: text/plain; charset="utf-8" +Content-Transfer-Encoding: 8bit + +Co-authored-by: Vít Ondruch +Backported-by: Antonio Terceiro +Origin: https://github.com/mikel/mail/commit/a20fdd591bd5b1596983f5e1ee6ffed4e0b1f5f9 +--- a/lib/mail/message.rb ++++ b/lib/mail/message.rb +@@ -1,6 +1,6 @@ + # encoding: utf-8 + # frozen_string_literal: true +-require "yaml" ++require "mail/yaml" + + module Mail + # The Message class provides a single point of access to all things to do with an +@@ -1867,7 +1867,7 @@ module Mail + end + + def self.from_yaml(str) +- hash = YAML.load(str) ++ hash = Mail::YAML.load(str) + m = self.new(:headers => hash['headers']) + hash.delete('headers') + hash.each do |k,v| +--- /dev/null ++++ b/lib/mail/yaml.rb +@@ -0,0 +1,30 @@ ++require 'yaml' ++ ++module Mail ++ module YAML ++ def self.load(yaml) ++ permitted_classes = [ ++ Symbol, ++ ++ Mail::Body, ++ ++ # Delivery methods as listed in mail/configuration.rb ++ Mail::SMTP, ++ Mail::Sendmail, ++ Mail::Exim, ++ Mail::FileDelivery, ++ Mail::SMTPConnection, ++ Mail::TestMailer, ++ Mail::LoggerDelivery, ++ ++ Mail.delivery_method.class, ++ ] ++ ++ if Gem::Version.new(Psych::VERSION) >= Gem::Version.new('3.1.0.pre1') ++ ::YAML.safe_load(yaml, :permitted_classes => permitted_classes) ++ else ++ ::YAML.safe_load(yaml, permitted_classes) ++ end ++ end ++ end ++end +--- a/spec/mail/message_spec.rb ++++ b/spec/mail/message_spec.rb +@@ -198,7 +198,7 @@ describe Mail::Message do + + it "should serialize the basic information to YAML" do + yaml = @yaml_mail.to_yaml +- yaml_output = YAML.load(yaml) ++ yaml_output = Mail::YAML.load(yaml) + expect(yaml_output['headers']['To']).to eq "someone@somewhere.com" + expect(yaml_output['headers']['Cc']).to eq "someoneelse@somewhere.com" + expect(yaml_output['headers']['Subject']).to eq "subject" +@@ -216,7 +216,7 @@ describe Mail::Message do + it "should serialize a Message with a custom delivery_handler" do + @yaml_mail.delivery_handler = DeliveryAgent + yaml = @yaml_mail.to_yaml +- yaml_output = YAML.load(yaml) ++ yaml_output = Mail::YAML.load(yaml) + expect(yaml_output['delivery_handler']).to eq "DeliveryAgent" + end + +@@ -228,7 +228,7 @@ describe Mail::Message do + + it "should not deserialize a delivery_handler that does not exist" do + yaml = @yaml_mail.to_yaml +- yaml_hash = YAML.load(yaml) ++ yaml_hash = Mail::YAML.load(yaml) + yaml_hash['delivery_handler'] = "NotARealClass" + deserialized = Mail::Message.from_yaml(yaml_hash.to_yaml) + expect(deserialized.delivery_handler).to be_nil +--- a/spec/mail/parts_list_spec.rb ++++ b/spec/mail/parts_list_spec.rb +@@ -89,6 +89,6 @@ describe "PartsList" do + + it "should have a round-tripping YAML serialization" do + p = Mail::PartsList.new([1, 2]) +- expect(YAML.load(YAML.dump(p))).to eq(p) ++ expect(Mail::YAML.load(YAML.dump(p))).to eq(p) + end + end +--- /dev/null ++++ b/spec/mail/yaml_spec.rb +@@ -0,0 +1,13 @@ ++# encoding: utf-8 ++# frozen_string_literal: true ++require 'spec_helper' ++ ++describe Mail::YAML do ++ ++ describe "#load" do ++ ++ it 'loads YAML' do ++ expect(Mail::YAML.load('{}')).to eq({}) ++ end ++ end ++end diff --git a/dev-ruby/mail/mail-2.7.1-r1.ebuild b/dev-ruby/mail/mail-2.7.1-r1.ebuild index 9646b2657694..e137da202092 100644 --- a/dev-ruby/mail/mail-2.7.1-r1.ebuild +++ b/dev-ruby/mail/mail-2.7.1-r1.ebuild @@ -1,8 +1,8 @@ -# Copyright 1999-2022 Gentoo Authors +# Copyright 1999-2023 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 -USE_RUBY="ruby26 ruby27 ruby30" +USE_RUBY="ruby26 ruby27 ruby30 ruby31" RUBY_FAKEGEM_RECIPE_TEST="rspec3" diff --git a/dev-ruby/mail/mail-2.7.1-r1.ebuild b/dev-ruby/mail/mail-2.7.1-r2.ebuild similarity index 68% copy from dev-ruby/mail/mail-2.7.1-r1.ebuild copy to dev-ruby/mail/mail-2.7.1-r2.ebuild index 9646b2657694..aa87cad31b49 100644 --- a/dev-ruby/mail/mail-2.7.1-r1.ebuild +++ b/dev-ruby/mail/mail-2.7.1-r2.ebuild @@ -1,8 +1,9 @@ -# Copyright 1999-2022 Gentoo Authors +# Copyright 1999-2023 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 -USE_RUBY="ruby26 ruby27 ruby30" + +USE_RUBY="ruby27 ruby30 ruby31 ruby32" RUBY_FAKEGEM_RECIPE_TEST="rspec3" @@ -21,11 +22,15 @@ SRC_URI="https://github.com/${GITHUB_USER}/mail/archive/${PV}.tar.gz -> ${P}-git LICENSE="MIT" SLOT="$(ver_cut 1-2)" -KEYWORDS="amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" +KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" IUSE="" ruby_add_rdepend ">=dev-ruby/mini_mime-0.1.1" +PATCHES=( + "${FILESDIR}"/${P}-psych-4.patch +) + all_ruby_prepare() { rm Gemfile || die sed -i -e '/[Bb]undle/d' -e '6d' Rakefile || die "Unable to remove Bundler code."