diff --git a/0001-deps-update-to-aho-corasick-0.7.patch b/0001-deps-update-to-aho-corasick-0.7.patch new file mode 100644 index 0000000..c9296da --- /dev/null +++ b/0001-deps-update-to-aho-corasick-0.7.patch @@ -0,0 +1,115 @@ +From cd9815cb376e4679af93a90a964cdb78173318da Mon Sep 17 00:00:00 2001 +From: Andrew Gallant +Date: Wed, 3 Apr 2019 13:51:26 -0400 +Subject: [PATCH] deps: update to aho-corasick 0.7 + +We do the simplest possible change to migrate to the new version. + +Fixes #1228 +--- + globset/src/lib.rs | 32 +++++++++++++++----------------- + 1 file changed, 15 insertions(+), 17 deletions(-) + +diff --git a/globset/src/lib.rs b/globset/src/lib.rs +index 7196b8f265fb..a558e15b1c00 100644 +--- a/globset/src/lib.rs ++++ b/globset/src/lib.rs +@@ -119,7 +119,7 @@ use std::hash; + use std::path::Path; + use std::str; + +-use aho_corasick::{Automaton, AcAutomaton, FullAcAutomaton}; ++use aho_corasick::AhoCorasick; + use regex::bytes::{Regex, RegexBuilder, RegexSet}; + + use pathutil::{ +@@ -648,7 +648,7 @@ impl ExtensionStrategy { + + #[derive(Clone, Debug)] + struct PrefixStrategy { +- matcher: FullAcAutomaton>, ++ matcher: AhoCorasick, + map: Vec, + longest: usize, + } +@@ -656,8 +656,8 @@ struct PrefixStrategy { + impl PrefixStrategy { + fn is_match(&self, candidate: &Candidate) -> bool { + let path = candidate.path_prefix(self.longest); +- for m in self.matcher.find_overlapping(path) { +- if m.start == 0 { ++ for m in self.matcher.find_overlapping_iter(path) { ++ if m.start() == 0 { + return true; + } + } +@@ -666,9 +666,9 @@ impl PrefixStrategy { + + fn matches_into(&self, candidate: &Candidate, matches: &mut Vec) { + let path = candidate.path_prefix(self.longest); +- for m in self.matcher.find_overlapping(path) { +- if m.start == 0 { +- matches.push(self.map[m.pati]); ++ for m in self.matcher.find_overlapping_iter(path) { ++ if m.start() == 0 { ++ matches.push(self.map[m.pattern()]); + } + } + } +@@ -676,7 +676,7 @@ impl PrefixStrategy { + + #[derive(Clone, Debug)] + struct SuffixStrategy { +- matcher: FullAcAutomaton>, ++ matcher: AhoCorasick, + map: Vec, + longest: usize, + } +@@ -684,8 +684,8 @@ struct SuffixStrategy { + impl SuffixStrategy { + fn is_match(&self, candidate: &Candidate) -> bool { + let path = candidate.path_suffix(self.longest); +- for m in self.matcher.find_overlapping(path) { +- if m.end == path.len() { ++ for m in self.matcher.find_overlapping_iter(path) { ++ if m.end() == path.len() { + return true; + } + } +@@ -694,9 +694,9 @@ impl SuffixStrategy { + + fn matches_into(&self, candidate: &Candidate, matches: &mut Vec) { + let path = candidate.path_suffix(self.longest); +- for m in self.matcher.find_overlapping(path) { +- if m.end == path.len() { +- matches.push(self.map[m.pati]); ++ for m in self.matcher.find_overlapping_iter(path) { ++ if m.end() == path.len() { ++ matches.push(self.map[m.pattern()]); + } + } + } +@@ -781,18 +781,16 @@ impl MultiStrategyBuilder { + } + + fn prefix(self) -> PrefixStrategy { +- let it = self.literals.into_iter().map(|s| s.into_bytes()); + PrefixStrategy { +- matcher: AcAutomaton::new(it).into_full(), ++ matcher: AhoCorasick::new_auto_configured(&self.literals), + map: self.map, + longest: self.longest, + } + } + + fn suffix(self) -> SuffixStrategy { +- let it = self.literals.into_iter().map(|s| s.into_bytes()); + SuffixStrategy { +- matcher: AcAutomaton::new(it).into_full(), ++ matcher: AhoCorasick::new_auto_configured(&self.literals), + map: self.map, + longest: self.longest, + } +-- +2.20.1 + diff --git a/globset-fix-metadata.diff b/globset-fix-metadata.diff new file mode 100644 index 0000000..a192022 --- /dev/null +++ b/globset-fix-metadata.diff @@ -0,0 +1,11 @@ +--- globset-0.4.2/Cargo.toml 1969-12-31T16:00:00-08:00 ++++ globset-0.4.2/Cargo.toml 2019-04-03T11:01:15.581946-07:00 +@@ -26,7 +26,7 @@ + name = "globset" + bench = false + [dependencies.aho-corasick] +-version = "0.6.8" ++version = "0.7.3" + + [dependencies.fnv] + version = "1.0.6" diff --git a/rust-globset.spec b/rust-globset.spec index 29b5b0b..9939ce3 100644 --- a/rust-globset.spec +++ b/rust-globset.spec @@ -7,18 +7,22 @@ Name: rust-%{crate} Version: 0.4.2 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Single glob and glob set matching # Upstream license specification: Unlicense/MIT License: Unlicense or MIT URL: https://crates.io/crates/globset -Source0: https://crates.io/api/v1/crates/%{crate}/%{version}/download#/%{crate}-%{version}.crate +Source: %{crates_source} +# Initial patched metadata +# * Update to aho-corasick 0.7: https://github.com/BurntSushi/ripgrep/commit/cd9815cb376e4679af93a90a964cdb78173318da +Patch0: globset-fix-metadata.diff +Patch1: 0001-deps-update-to-aho-corasick-0.7.patch ExclusiveArch: %{rust_arches} BuildRequires: rust-packaging -BuildRequires: (crate(aho-corasick/default) >= 0.6.8 with crate(aho-corasick/default) < 0.7.0) +BuildRequires: (crate(aho-corasick/default) >= 0.7.3 with crate(aho-corasick/default) < 0.8.0) BuildRequires: (crate(fnv/default) >= 1.0.6 with crate(fnv/default) < 2.0.0) BuildRequires: (crate(log/default) >= 0.4.5 with crate(log/default) < 0.5.0) BuildRequires: (crate(memchr/default) >= 2.0.2 with crate(memchr/default) < 3.0.0) @@ -73,7 +77,9 @@ which use "simd-accel" feature of "%{crate}" crate. %ghost %{cargo_registry}/%{crate}-%{version}/Cargo.toml %prep -%autosetup -n %{crate}-%{version} -p1 +%autosetup -n %{crate}-%{version_no_tilde} -N +%patch0 -p1 +%patch1 -p2 %cargo_prep %build @@ -88,6 +94,9 @@ which use "simd-accel" feature of "%{crate}" crate. %endif %changelog +* Wed Apr 03 2019 Josh Stone - 0.4.2-4 +- Update to aho-corasick 0.7 + * Sat Feb 02 2019 Fedora Release Engineering - 0.4.2-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild