Update to 0.4.4

Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
epel9
Igor Gnatenko 7 years ago
parent 806ac6a306
commit a415e6e14a
No known key found for this signature in database
GPG Key ID: 695714BD1BBC5F4C

1
.gitignore vendored

@ -3,3 +3,4 @@
/ignore-0.4.1.crate
/ignore-0.4.2.crate
/ignore-0.4.3.crate
/ignore-0.4.4.crate

@ -1,47 +0,0 @@
From 0863c75a5a819dc94754f3465246366ffd5d541f Mon Sep 17 00:00:00 2001
From: Andrew Gallant <jamslam@gmail.com>
Date: Sun, 29 Jul 2018 08:30:53 -0400
Subject: [PATCH 1/3] ignore: fix bug in matched_path_or_any_parents
This method was supposed to panic whenever the given path wasn't under
the root of the gitignore patcher. Instead of using assert!, it was using
debug_assert!. This actually caused tests to fail when running under
release mode, because the debug_assert! wouldn't trip.
Fixes #671
---
ignore/src/gitignore.rs | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/ignore/src/gitignore.rs b/ignore/src/gitignore.rs
index 2a3016b..d661c84 100644
--- a/ignore/src/gitignore.rs
+++ b/ignore/src/gitignore.rs
@@ -220,6 +220,11 @@ impl Gitignore {
/// determined by a common suffix of the directory containing this
/// gitignore) is stripped. If there is no common suffix/prefix overlap,
/// then `path` is assumed to be relative to this matcher.
+ ///
+ /// # Panics
+ ///
+ /// This method panics if the given file path is not under the root path
+ /// of this matcher.
pub fn matched_path_or_any_parents<P: AsRef<Path>>(
&self,
path: P,
@@ -229,10 +234,8 @@ impl Gitignore {
return Match::None;
}
let mut path = self.strip(path.as_ref());
- debug_assert!(
- !path.has_root(),
- "path is expect to be under the root"
- );
+ assert!(!path.has_root(), "path is expect to be under the root");
+
match self.matched_stripped(path, is_dir) {
Match::None => (), // walk up
a_match => return a_match,
--
2.18.0

@ -1,191 +0,0 @@
From 45473ba48f0561e970596ac979ba5d0bac92242a Mon Sep 17 00:00:00 2001
From: Andrew Gallant <jamslam@gmail.com>
Date: Sun, 29 Jul 2018 08:31:04 -0400
Subject: [PATCH 2/3] ignore/style: 80 columns, dammit
---
...gnore_matched_path_or_any_parents_tests.rs | 80 ++++++++++++-------
1 file changed, 53 insertions(+), 27 deletions(-)
diff --git a/ignore/tests/gitignore_matched_path_or_any_parents_tests.rs b/ignore/tests/gitignore_matched_path_or_any_parents_tests.rs
index 4de7cf3..28d8e2f 100644
--- a/ignore/tests/gitignore_matched_path_or_any_parents_tests.rs
+++ b/ignore/tests/gitignore_matched_path_or_any_parents_tests.rs
@@ -1,13 +1,11 @@
extern crate ignore;
-
use std::path::Path;
use ignore::gitignore::{Gitignore, GitignoreBuilder};
-
-const IGNORE_FILE: &'static str = "tests/gitignore_matched_path_or_any_parents_tests.gitignore";
-
+const IGNORE_FILE: &'static str =
+ "tests/gitignore_matched_path_or_any_parents_tests.gitignore";
fn get_gitignore() -> Gitignore {
let mut builder = GitignoreBuilder::new("ROOT");
@@ -16,9 +14,8 @@ fn get_gitignore() -> Gitignore {
builder.build().unwrap()
}
-
#[test]
-#[should_panic(expected = "path is expect to be under the root")]
+#[should_panic(expected = "path is expected to be under the root")]
fn test_path_should_be_under_root() {
let gitignore = get_gitignore();
let path = "/tmp/some_file";
@@ -26,11 +23,12 @@ fn test_path_should_be_under_root() {
assert!(false);
}
-
#[test]
fn test_files_in_root() {
let gitignore = get_gitignore();
- let m = |path: &str| gitignore.matched_path_or_any_parents(Path::new(path), false);
+ let m = |path: &str| {
+ gitignore.matched_path_or_any_parents(Path::new(path), false)
+ };
// 0x
assert!(m("ROOT/file_root_00").is_ignore());
@@ -61,7 +59,9 @@ fn test_files_in_root() {
#[test]
fn test_files_in_deep() {
let gitignore = get_gitignore();
- let m = |path: &str| gitignore.matched_path_or_any_parents(Path::new(path), false);
+ let m = |path: &str| {
+ gitignore.matched_path_or_any_parents(Path::new(path), false)
+ };
// 0x
assert!(m("ROOT/parent_dir/file_deep_00").is_ignore());
@@ -92,8 +92,9 @@ fn test_files_in_deep() {
#[test]
fn test_dirs_in_root() {
let gitignore = get_gitignore();
- let m =
- |path: &str, is_dir: bool| gitignore.matched_path_or_any_parents(Path::new(path), is_dir);
+ let m = |path: &str, is_dir: bool| {
+ gitignore.matched_path_or_any_parents(Path::new(path), is_dir)
+ };
// 00
assert!(m("ROOT/dir_root_00", true).is_ignore());
@@ -196,20 +197,25 @@ fn test_dirs_in_root() {
#[test]
fn test_dirs_in_deep() {
let gitignore = get_gitignore();
- let m =
- |path: &str, is_dir: bool| gitignore.matched_path_or_any_parents(Path::new(path), is_dir);
+ let m = |path: &str, is_dir: bool| {
+ gitignore.matched_path_or_any_parents(Path::new(path), is_dir)
+ };
// 00
assert!(m("ROOT/parent_dir/dir_deep_00", true).is_ignore());
assert!(m("ROOT/parent_dir/dir_deep_00/file", false).is_ignore());
assert!(m("ROOT/parent_dir/dir_deep_00/child_dir", true).is_ignore());
- assert!(m("ROOT/parent_dir/dir_deep_00/child_dir/file", false).is_ignore());
+ assert!(
+ m("ROOT/parent_dir/dir_deep_00/child_dir/file", false).is_ignore()
+ );
// 01
assert!(m("ROOT/parent_dir/dir_deep_01", true).is_ignore());
assert!(m("ROOT/parent_dir/dir_deep_01/file", false).is_ignore());
assert!(m("ROOT/parent_dir/dir_deep_01/child_dir", true).is_ignore());
- assert!(m("ROOT/parent_dir/dir_deep_01/child_dir/file", false).is_ignore());
+ assert!(
+ m("ROOT/parent_dir/dir_deep_01/child_dir/file", false).is_ignore()
+ );
// 02
assert!(m("ROOT/parent_dir/dir_deep_02", true).is_none());
@@ -251,47 +257,67 @@ fn test_dirs_in_deep() {
assert!(m("ROOT/parent_dir/dir_deep_20", true).is_ignore());
assert!(m("ROOT/parent_dir/dir_deep_20/file", false).is_ignore());
assert!(m("ROOT/parent_dir/dir_deep_20/child_dir", true).is_ignore());
- assert!(m("ROOT/parent_dir/dir_deep_20/child_dir/file", false).is_ignore());
+ assert!(
+ m("ROOT/parent_dir/dir_deep_20/child_dir/file", false).is_ignore()
+ );
// 21
assert!(m("ROOT/parent_dir/dir_deep_21", true).is_ignore());
assert!(m("ROOT/parent_dir/dir_deep_21/file", false).is_ignore());
assert!(m("ROOT/parent_dir/dir_deep_21/child_dir", true).is_ignore());
- assert!(m("ROOT/parent_dir/dir_deep_21/child_dir/file", false).is_ignore());
+ assert!(
+ m("ROOT/parent_dir/dir_deep_21/child_dir/file", false).is_ignore()
+ );
// 22
- assert!(m("ROOT/parent_dir/dir_deep_22", true).is_none()); // dir itself doesn't match
+ // dir itself doesn't match
+ assert!(m("ROOT/parent_dir/dir_deep_22", true).is_none());
assert!(m("ROOT/parent_dir/dir_deep_22/file", false).is_ignore());
assert!(m("ROOT/parent_dir/dir_deep_22/child_dir", true).is_ignore());
- assert!(m("ROOT/parent_dir/dir_deep_22/child_dir/file", false).is_ignore());
+ assert!(
+ m("ROOT/parent_dir/dir_deep_22/child_dir/file", false).is_ignore()
+ );
// 23
- assert!(m("ROOT/parent_dir/dir_deep_23", true).is_none()); // dir itself doesn't match
+ // dir itself doesn't match
+ assert!(m("ROOT/parent_dir/dir_deep_23", true).is_none());
assert!(m("ROOT/parent_dir/dir_deep_23/file", false).is_ignore());
assert!(m("ROOT/parent_dir/dir_deep_23/child_dir", true).is_ignore());
- assert!(m("ROOT/parent_dir/dir_deep_23/child_dir/file", false).is_ignore());
+ assert!(
+ m("ROOT/parent_dir/dir_deep_23/child_dir/file", false).is_ignore()
+ );
// 30
assert!(m("ROOT/parent_dir/dir_deep_30", true).is_ignore());
assert!(m("ROOT/parent_dir/dir_deep_30/file", false).is_ignore());
assert!(m("ROOT/parent_dir/dir_deep_30/child_dir", true).is_ignore());
- assert!(m("ROOT/parent_dir/dir_deep_30/child_dir/file", false).is_ignore());
+ assert!(
+ m("ROOT/parent_dir/dir_deep_30/child_dir/file", false).is_ignore()
+ );
// 31
assert!(m("ROOT/parent_dir/dir_deep_31", true).is_ignore());
assert!(m("ROOT/parent_dir/dir_deep_31/file", false).is_ignore());
assert!(m("ROOT/parent_dir/dir_deep_31/child_dir", true).is_ignore());
- assert!(m("ROOT/parent_dir/dir_deep_31/child_dir/file", false).is_ignore());
+ assert!(
+ m("ROOT/parent_dir/dir_deep_31/child_dir/file", false).is_ignore()
+ );
// 32
- assert!(m("ROOT/parent_dir/dir_deep_32", true).is_none()); // dir itself doesn't match
+ // dir itself doesn't match
+ assert!(m("ROOT/parent_dir/dir_deep_32", true).is_none());
assert!(m("ROOT/parent_dir/dir_deep_32/file", false).is_ignore());
assert!(m("ROOT/parent_dir/dir_deep_32/child_dir", true).is_ignore());
- assert!(m("ROOT/parent_dir/dir_deep_32/child_dir/file", false).is_ignore());
+ assert!(
+ m("ROOT/parent_dir/dir_deep_32/child_dir/file", false).is_ignore()
+ );
// 33
- assert!(m("ROOT/parent_dir/dir_deep_33", true).is_none()); // dir itself doesn't match
+ // dir itself doesn't match
+ assert!(m("ROOT/parent_dir/dir_deep_33", true).is_none());
assert!(m("ROOT/parent_dir/dir_deep_33/file", false).is_ignore());
assert!(m("ROOT/parent_dir/dir_deep_33/child_dir", true).is_ignore());
- assert!(m("ROOT/parent_dir/dir_deep_33/child_dir/file", false).is_ignore());
+ assert!(
+ m("ROOT/parent_dir/dir_deep_33/child_dir/file", false).is_ignore()
+ );
}
--
2.18.0

@ -1,25 +0,0 @@
From 651a0f1ddfcb3e37647199863d2ce1d1db3c56af Mon Sep 17 00:00:00 2001
From: Andrew Gallant <jamslam@gmail.com>
Date: Sun, 29 Jul 2018 08:37:24 -0400
Subject: [PATCH 3/3] ignore: fix typo
---
ignore/src/gitignore.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ignore/src/gitignore.rs b/ignore/src/gitignore.rs
index d661c84..15827fd 100644
--- a/ignore/src/gitignore.rs
+++ b/ignore/src/gitignore.rs
@@ -234,7 +234,7 @@ impl Gitignore {
return Match::None;
}
let mut path = self.strip(path.as_ref());
- assert!(!path.has_root(), "path is expect to be under the root");
+ assert!(!path.has_root(), "path is expected to be under the root");
match self.matched_stripped(path, is_dir) {
Match::None => (), // walk up
--
2.18.0

@ -1,9 +0,0 @@
--- ignore-0.4.3/Cargo.toml 1970-01-01T01:00:00+01:00
+++ ignore-0.4.3/Cargo.toml 2018-07-29T07:38:06.998096+02:00
@@ -56,6 +56,3 @@
[features]
simd-accel = ["globset/simd-accel"]
-[target."cfg(windows)".dependencies.winapi]
-version = "0.3"
-features = ["std", "winnt"]

@ -0,0 +1,8 @@
--- ignore-0.4.4/Cargo.toml 1970-01-01T01:00:00+01:00
+++ ignore-0.4.4/Cargo.toml 2018-09-08T23:40:02.288602+02:00
@@ -56,5 +56,3 @@
[features]
simd-accel = ["globset/simd-accel"]
-[target."cfg(windows)".dependencies.winapi-util]
-version = "0.1.1"

@ -6,36 +6,34 @@
%global crate ignore
Name: rust-%{crate}
Version: 0.4.3
Release: 2%{?dist}
Version: 0.4.4
Release: 1%{?dist}
Summary: Fast library for efficiently matching ignore files
# Upstream license specification: Unlicense/MIT
License: Unlicense or MIT
URL: https://crates.io/crates/ignore
Source0: https://crates.io/api/v1/crates/%{crate}/%{version}/download#/%{crate}-%{version}.crate
# Initial patched metadata
# * No windows
Patch0: ignore-0.4.3-fix-metadata.diff
Patch0001: 0001-ignore-fix-bug-in-matched_path_or_any_parents.patch
Patch0002: 0002-ignore-style-80-columns-dammit.patch
Patch0003: 0003-ignore-fix-typo.patch
Patch0: ignore-fix-metadata.diff
ExclusiveArch: %{rust_arches}
BuildRequires: rust-packaging
# [dependencies]
BuildRequires: (crate(crossbeam) >= 0.3.0 with crate(crossbeam) < 0.4.0)
BuildRequires: (crate(globset) >= 0.4.0 with crate(globset) < 0.5.0)
BuildRequires: (crate(lazy_static) >= 1.0.0 with crate(lazy_static) < 2.0.0)
BuildRequires: (crate(log) >= 0.4.0 with crate(log) < 0.5.0)
BuildRequires: (crate(memchr) >= 2.0.0 with crate(memchr) < 3.0.0)
BuildRequires: (crate(regex) >= 1.0.0 with crate(regex) < 2.0.0)
BuildRequires: (crate(same-file) >= 1.0.0 with crate(same-file) < 2.0.0)
BuildRequires: (crate(thread_local) >= 0.3.2 with crate(thread_local) < 0.4.0)
BuildRequires: (crate(walkdir) >= 2.0.0 with crate(walkdir) < 3.0.0)
BuildRequires: (crate(crossbeam-channel) >= 0.2.4 with crate(crossbeam-channel) < 0.3.0)
BuildRequires: (crate(globset) >= 0.4.2 with crate(globset) < 0.5.0)
BuildRequires: (crate(lazy_static) >= 1.1.0 with crate(lazy_static) < 2.0.0)
BuildRequires: (crate(log) >= 0.4.5 with crate(log) < 0.5.0)
BuildRequires: (crate(memchr) >= 2.0.2 with crate(memchr) < 3.0.0)
BuildRequires: (crate(regex) >= 1.0.5 with crate(regex) < 2.0.0)
BuildRequires: (crate(same-file) >= 1.0.3 with crate(same-file) < 2.0.0)
BuildRequires: (crate(thread_local) >= 0.3.6 with crate(thread_local) < 0.4.0)
BuildRequires: (crate(walkdir) >= 2.2.5 with crate(walkdir) < 3.0.0)
%if %{with check}
# [dev-dependencies]
BuildRequires: (crate(tempdir) >= 0.3.5 with crate(tempdir) < 0.4.0)
BuildRequires: (crate(tempdir) >= 0.3.7 with crate(tempdir) < 0.4.0)
%endif
%description
@ -53,11 +51,7 @@ This package contains library source intended for building other packages
which use %{crate} from crates.io.
%prep
%autosetup -n %{crate}-%{version} -N
%patch0 -p1
%patch1 -p2
%patch2 -p2
%patch3 -p2
%autosetup -n %{crate}-%{version} -p1
%cargo_prep
%build
@ -77,6 +71,9 @@ which use %{crate} from crates.io.
%{cargo_registry}/%{crate}-%{version}/
%changelog
* Sat Sep 08 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.4.4-1
- Update to 0.4.4
* Sun Jul 29 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.4.3-2
- Apply panic from upstream

@ -1 +1 @@
SHA512 (ignore-0.4.3.crate) = a4372de85ee945e68c503e743f28621d88e19facd2ec0af5dd2cfccc45c8ad25abc655c16020427a4357bd0c07f48348ccd2d19dc7d6b9046d13fcb33973a06a
SHA512 (ignore-0.4.4.crate) = b7dd5de1c14b77483d22235c4738f39123011bc8c19b785fb528d30fbfe9e9c2f8e3b137ad2d3516ce8f59c2ae06bddbe80811423fcc5ef76cb851fa7ad866d9

Loading…
Cancel
Save