From 08b5feaaa828d34d9cef105770967ec886f1d234 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 23 Jan 2020 17:19:47 -0800 Subject: [PATCH] Bump to thread_local 1 --- 0001-deps-update-to-thread_local-1.0.patch | 27 ++++++++++++++++++++++ grep-regex-fix-metadata.diff | 8 +++++++ rust-grep-regex.spec | 15 ++++++++---- 3 files changed, 46 insertions(+), 4 deletions(-) create mode 100644 0001-deps-update-to-thread_local-1.0.patch create mode 100644 grep-regex-fix-metadata.diff diff --git a/0001-deps-update-to-thread_local-1.0.patch b/0001-deps-update-to-thread_local-1.0.patch new file mode 100644 index 0000000..d06a46c --- /dev/null +++ b/0001-deps-update-to-thread_local-1.0.patch @@ -0,0 +1,27 @@ +From cb2f6ddc61b79b7acf59bb00a6be9f1740aa55b8 Mon Sep 17 00:00:00 2001 +From: Andrew Gallant +Date: Thu, 9 Jan 2020 20:58:28 -0500 +Subject: [PATCH] deps: update to thread_local 1.0 + +We also update the pcre2 and regex dependencies, which removes any other +lingering uses of thread_local 0.3. +--- + grep-regex/src/word.rs | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/word.rs b/src/word.rs +index ff1e5dc3f6cb..9941bab02316 100644 +--- a/src/word.rs ++++ b/src/word.rs +@@ -78,7 +78,7 @@ impl Matcher for WordMatcher { + // if it's worth it. + + let cell = self.locs.get_or(|| { +- Box::new(RefCell::new(self.regex.capture_locations())) ++ RefCell::new(self.regex.capture_locations()) + }); + let mut caps = cell.borrow_mut(); + self.regex.captures_read_at(&mut caps, haystack, at); +-- +2.24.1 + diff --git a/grep-regex-fix-metadata.diff b/grep-regex-fix-metadata.diff new file mode 100644 index 0000000..a744c30 --- /dev/null +++ b/grep-regex-fix-metadata.diff @@ -0,0 +1,8 @@ +--- grep-regex-0.1.5/Cargo.toml 1970-01-01T00:00:00+00:00 ++++ grep-regex-0.1.5/Cargo.toml 2020-01-24T01:08:38.168482+00:00 +@@ -37,4 +37,4 @@ + version = "0.6.5" + + [dependencies.thread_local] +-version = "0.3.6" ++version = "1" diff --git a/rust-grep-regex.spec b/rust-grep-regex.spec index dd2ee8e..8d26792 100644 --- a/rust-grep-regex.spec +++ b/rust-grep-regex.spec @@ -1,4 +1,4 @@ -# Generated by rust2rpm 10 +# Generated by rust2rpm 13 %bcond_without check %global debug_package %{nil} @@ -6,13 +6,17 @@ Name: rust-%{crate} Version: 0.1.5 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Use Rust's regex library with the 'grep' crate # Upstream license specification: Unlicense/MIT License: Unlicense or MIT URL: https://crates.io/crates/grep-regex Source: %{crates_source} +# Initial patched metadata +# * Bump to thread_local 1, https://github.com/BurntSushi/ripgrep/commit/cb2f6ddc61b79b7acf59bb00a6be9f1740aa55b8 +Patch0: grep-regex-fix-metadata.diff +Patch1: 0001-deps-update-to-thread_local-1.0.patch ExclusiveArch: %{rust_arches} %if %{__cargo_skip_build} @@ -38,7 +42,7 @@ which use "%{crate}" crate. %files devel %license UNLICENSE LICENSE-MIT %doc README.md -%{cargo_registry}/%{crate}-%{version}/ +%{cargo_registry}/%{crate}-%{version_no_tilde}/ %package -n %{name}+default-devel Summary: %{summary} @@ -50,7 +54,7 @@ This package contains library source intended for building other packages which use "default" feature of "%{crate}" crate. %files -n %{name}+default-devel -%ghost %{cargo_registry}/%{crate}-%{version}/Cargo.toml +%ghost %{cargo_registry}/%{crate}-%{version_no_tilde}/Cargo.toml %prep %autosetup -n %{crate}-%{version_no_tilde} -p1 @@ -71,6 +75,9 @@ which use "default" feature of "%{crate}" crate. %endif %changelog +* Thu Jan 23 2020 Josh Stone - 0.1.5-2 +- Bump to thread_local 1 + * Sun Sep 08 09:27:05 CEST 2019 Igor Gnatenko - 0.1.5-1 - Update to 0.1.5