Update to Active Support 5.2.0.

Also, enhance .spec file.
f38
Pavel Valena 7 years ago
parent f18c1c2425
commit 1c1a14cbe4

@ -1,26 +0,0 @@
From ca4be4b7788c90d94beb1e835b7019f809148d08 Mon Sep 17 00:00:00 2001
From: Andrew White <andrew.white@unboxed.co>
Date: Mon, 2 Apr 2018 09:34:53 +0100
Subject: [PATCH] Backport fix for Dir::Tmpname.create from #32386
The removal of path separators from the tmpname value affects all four
supported versions of Ruby - 2.2.10, 2.3.7, 2.4.4, and 2.5.1.
---
activesupport/test/caching_test.rb | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/activesupport/test/caching_test.rb b/activesupport/test/caching_test.rb
index c67ffe69b80a..c138f10c13a5 100644
--- a/activesupport/test/caching_test.rb
+++ b/activesupport/test/caching_test.rb
@@ -854,7 +854,9 @@ def test_key_transformation_with_pathname
def test_filename_max_size
key = "#{'A' * ActiveSupport::Cache::FileStore::FILENAME_MAX_SIZE}"
path = @cache.send(:normalize_key, key, {})
- Dir::Tmpname.create(path) do |tmpname, n, opts|
+ basename = File.basename(path)
+ dirname = File.dirname(path)
+ Dir::Tmpname.create(basename, Dir.tmpdir + dirname) do |tmpname, n, opts|
assert File.basename(tmpname + ".lock").length <= 255, "Temp filename too long: #{File.basename(tmpname + '.lock').length}"
end
end

@ -0,0 +1,22 @@
From 01f20c753e89f75e0031d0853866aaaa68ee1cc7 Mon Sep 17 00:00:00 2001
From: utilum <oz@utilum.com>
Date: Fri, 30 Mar 2018 23:53:23 +0200
Subject: [PATCH] Fix: FileStoreTest#test_filename_max_size fails in Ruby 2.5.1
---
activesupport/test/cache/stores/file_store_test.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/activesupport/test/cache/stores/file_store_test.rb b/activesupport/test/cache/stores/file_store_test.rb
index c3c35a7bccfe..9aee8239799e 100644
--- a/activesupport/test/cache/stores/file_store_test.rb
+++ b/activesupport/test/cache/stores/file_store_test.rb
@@ -69,7 +69,7 @@ def test_filename_max_size
key = "#{'A' * ActiveSupport::Cache::FileStore::FILENAME_MAX_SIZE}"
path = @cache.send(:normalize_key, key, {})
Dir::Tmpname.create(path) do |tmpname, n, opts|
- assert File.basename(tmpname + ".lock").length <= 255, "Temp filename too long: #{File.basename(tmpname + '.lock').length}"
+ assert File.basename(key + tmpname.split(key).last + ".lock").length <= 255, "Temp filename too long: #{File.basename(tmpname + '.lock').length}"
end
end

@ -2,10 +2,9 @@
Name: rubygem-%{gem_name} Name: rubygem-%{gem_name}
Epoch: 1 Epoch: 1
Version: 5.1.5 Version: 5.2.0
Release: 3%{?dist} Release: 1%{?dist}
Summary: A support libraries and Ruby core extensions extracted from the Rails framework Summary: A support libraries and Ruby core extensions extracted from the Rails framework
Group: Development/Languages
License: MIT License: MIT
URL: http://rubyonrails.org URL: http://rubyonrails.org
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
@ -14,12 +13,11 @@ Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
# Rails rpms, you may check it out like so # Rails rpms, you may check it out like so
# git clone http://github.com/rails/rails.git # git clone http://github.com/rails/rails.git
# cd rails/activesupport/ # cd rails/activesupport/
# git checkout v5.1.5 && tar czvf activesupport-5.1.5-tests.tgz test/ # git checkout v5.2.0 && tar czvf activesupport-5.2.0-tests.tgz test/
Source1: %{gem_name}-%{version}-tests.tgz Source1: %{gem_name}-%{version}-tests.tgz
# Fix: file separators removal from tmpname value
# Fix test suite issue caused by fix of CVE-2018-6914 in Ruby. # https://github.com/rails/rails/pull/32386/
# https://github.com/rails/rails/commit/ca4be4b7788c90d94beb1e835b7019f809148d08 Patch0: rubygem-activesupport-5.2.0-Fix-FileStoreTest-test_filename_max_size-fails.patch
Patch1: rubygem-activesupport-5.1.7-Fix-FileStoreTest-test_filename_max_size-fails.patch
# ruby package has just soft dependency on rubygem({bigdecimal,json}), while # ruby package has just soft dependency on rubygem({bigdecimal,json}), while
# ActiveSupport always requires them. # ActiveSupport always requires them.
@ -33,12 +31,14 @@ BuildRequires: ruby >= 2.2.2
BuildRequires: rubygem(bigdecimal) BuildRequires: rubygem(bigdecimal)
BuildRequires: rubygem(builder) BuildRequires: rubygem(builder)
BuildRequires: rubygem(concurrent-ruby) BuildRequires: rubygem(concurrent-ruby)
BuildRequires: rubygem(connection_pool)
BuildRequires: rubygem(dalli) BuildRequires: rubygem(dalli)
BuildRequires: rubygem(i18n) >= 0.6.9 BuildRequires: (rubygem(i18n) >= 0.7 with rubygem(i18n) < 2)
BuildRequires: rubygem(minitest) >= 5.0.0 BuildRequires: rubygem(minitest) >= 5.0.0
BuildRequires: rubygem(rack) BuildRequires: rubygem(rack)
BuildRequires: rubygem(tzinfo) >= 1.1 BuildRequires: rubygem(tzinfo) >= 1.1
BuildRequires: rubygem(listen) BuildRequires: rubygem(listen)
BuildRequires: rubygem(redis)
BuildRequires: memcached BuildRequires: memcached
BuildArch: noarch BuildArch: noarch
@ -50,7 +50,6 @@ time zones, and testing.
%package doc %package doc
Summary: Documentation for %{name} Summary: Documentation for %{name}
Group: Documentation
Requires: %{name} = %{epoch}:%{version}-%{release} Requires: %{name} = %{epoch}:%{version}-%{release}
BuildArch: noarch BuildArch: noarch
@ -60,10 +59,6 @@ Documentation for %{name}.
%prep %prep
%setup -q -n %{gem_name}-%{version} %setup -q -n %{gem_name}-%{version}
# https://github.com/rails/rails/pull/31991
%gemspec_remove_dep -s ../%{gem_name}-%{version}.gemspec -g i18n '~> 0.7'
%gemspec_add_dep -s ../%{gem_name}-%{version}.gemspec -g i18n '~> 1.0'
%build %build
gem build ../%{gem_name}-%{version}.gemspec gem build ../%{gem_name}-%{version}.gemspec
@ -79,10 +74,13 @@ pushd .%{gem_instdir}
# Move the tests into place # Move the tests into place
tar xzvf %{SOURCE1} tar xzvf %{SOURCE1}
cat %{PATCH1} | patch -p2 cat %{PATCH0} | patch -p2
# These tests are really unstable, but they seems to be passing upstream :/ # These tests are really unstable, but they seems to be passing upstream :/
for f in test/evented_file_update_checker_test.rb; do for f in \
test/evented_file_update_checker_test.rb \
test/cache/stores/redis_cache_store_test.rb # failed to require "redis/connection/hiredis"
do
mv $f{,.disable} mv $f{,.disable}
done done
@ -92,6 +90,7 @@ sed -i '/def test_iso8601_output_and_reparsing$/,/^ end$/ s/^/#/' test/core_ext
memcached & memcached &
mPID=$! mPID=$!
sleep 1
ruby -Ilib:test -e 'Dir.glob "./test/**/*_test.rb", &method(:require)' ruby -Ilib:test -e 'Dir.glob "./test/**/*_test.rb", &method(:require)'
kill -15 $mPID kill -15 $mPID
popd popd
@ -109,6 +108,9 @@ popd
%doc %{gem_instdir}/README.rdoc %doc %{gem_instdir}/README.rdoc
%changelog %changelog
* Mon Apr 23 2018 Pavel Valena <pvalena@redhat.com> - 1:5.2.0-1
- Update to Active Support 5.2.0.
* Mon Apr 16 2018 Vít Ondruch <vondruch@redhat.com> - 1:5.1.5-3 * Mon Apr 16 2018 Vít Ondruch <vondruch@redhat.com> - 1:5.1.5-3
- Fix test suite issue caused by fix of CVE-2018-6914 in Ruby. - Fix test suite issue caused by fix of CVE-2018-6914 in Ruby.

@ -1,2 +1,2 @@
SHA512 (activesupport-5.1.5.gem) = 6e20f069f4e2e20a8ea762e02be9f136a32535b871b4c6f2a59600393201f6d01dbd2696a74024811c168e8d6c223e5a4fa0eda3ba30d87a3c2216fba0aedd05 SHA512 (activesupport-5.2.0-tests.tgz) = 72085a71720d6931f8acedc9d6e20f0ee7910cc7c85ed05bedafd49d730ff6b1f1c19fa7f2faa021c2df5907e4d63aa1af7a7e373a6c55300d53be34ecee437f
SHA512 (activesupport-5.1.5-tests.tgz) = 11be71318b4e9f1365d18d72fc527c87837782b62adb6498c423edd2a40687ad22b43b05e983528b6a4d1690376d64adecad816ec8bfd298d7352307e63acd89 SHA512 (activesupport-5.2.0.gem) = 606ea2168abc2c0ac1310c560c22e8d708f586c9cfa1e132ed50069eb61db4e4a16138598d83ff020beb3171236f3ddae25b38c315add03b89a04af578900252

Loading…
Cancel
Save