From d58f3cc98776e4017cd5a9299e4684ff38f628f1 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Thu, 30 Nov 2017 17:22:58 +0100 Subject: [PATCH] Update to 1.2.1 Signed-off-by: Igor Gnatenko --- .gitignore | 1 + ..._-u-int_-native_endian-on-BE-targets.patch | 52 ------------------- byteorder-1.2.1-fix-metadata.diff | 11 ++++ rust-byteorder.spec | 12 +++-- sources | 2 +- 5 files changed, 21 insertions(+), 57 deletions(-) delete mode 100644 0001-Fix-prop_ext_-u-int_-native_endian-on-BE-targets.patch create mode 100644 byteorder-1.2.1-fix-metadata.diff diff --git a/.gitignore b/.gitignore index e8db4b3..c4f6f7a 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /byteorder-1.1.0.crate +/byteorder-1.2.1.crate diff --git a/0001-Fix-prop_ext_-u-int_-native_endian-on-BE-targets.patch b/0001-Fix-prop_ext_-u-int_-native_endian-on-BE-targets.patch deleted file mode 100644 index c26da66..0000000 --- a/0001-Fix-prop_ext_-u-int_-native_endian-on-BE-targets.patch +++ /dev/null @@ -1,52 +0,0 @@ -From 403638e8d7ca2b0cd24034976c7a164bbd15b4dd Mon Sep 17 00:00:00 2001 -From: Josh Stone -Date: Mon, 13 Nov 2017 11:26:47 -0800 -Subject: [PATCH] Fix prop_ext_[u]int_*::native_endian on BE targets - -The similar `big_endian` tests were using an offset to read from the -end of the written `u64`, but the `native_endian` tests were reading -directly, just like the `little_endian` tests. That's of course only -correct when the target actually is little endian. - -That `big_endian` offset is now sliced directly, instead of cloning into -another vector, and then this logic is also used in the `native_endian` -test, depending on the current `#[cfg(target_endian)]`. - -Fixes #102. ---- - src/lib.rs | 12 ++++++++---- - 1 file changed, 8 insertions(+), 4 deletions(-) - -diff --git a/src/lib.rs b/src/lib.rs -index b60fe7c..35c0069 100644 ---- a/src/lib.rs -+++ b/src/lib.rs -@@ -2865,9 +2865,8 @@ mod stdtests { - fn prop(n: $ty_int) -> bool { - let mut wtr = vec![]; - wtr.$write::(n.clone()).unwrap(); -- let mut rdr = Vec::new(); -- rdr.extend(wtr[wtr.len()-$bytes..].iter().map(|&x| x)); -- let mut rdr = Cursor::new(rdr); -+ let offset = wtr.len() - $bytes; -+ let mut rdr = Cursor::new(&mut wtr[offset..]); - n == rdr.$read::($bytes).unwrap() - } - qc_sized(prop as fn($ty_int) -> bool, $max); -@@ -2889,7 +2888,12 @@ mod stdtests { - fn prop(n: $ty_int) -> bool { - let mut wtr = vec![]; - wtr.$write::(n.clone()).unwrap(); -- let mut rdr = Cursor::new(wtr); -+ let offset = if cfg!(target_endian = "big") { -+ wtr.len() - $bytes -+ } else { -+ 0 -+ }; -+ let mut rdr = Cursor::new(&mut wtr[offset..]); - n == rdr.$read::($bytes).unwrap() - } - qc_sized(prop as fn($ty_int) -> bool, $max); --- -2.15.0 - diff --git a/byteorder-1.2.1-fix-metadata.diff b/byteorder-1.2.1-fix-metadata.diff new file mode 100644 index 0000000..ceea7f0 --- /dev/null +++ b/byteorder-1.2.1-fix-metadata.diff @@ -0,0 +1,11 @@ +--- byteorder-1.2.1/Cargo.toml 1970-01-01T01:00:00+01:00 ++++ byteorder-1.2.1/Cargo.toml 2017-11-30T17:22:26.819390+01:00 +@@ -29,7 +29,7 @@ + name = "byteorder" + bench = false + [dev-dependencies.quickcheck] +-version = "0.4" ++version = "0.5" + default-features = false + + [dev-dependencies.rand] diff --git a/rust-byteorder.spec b/rust-byteorder.spec index 7c1e1b9..3aa0af5 100644 --- a/rust-byteorder.spec +++ b/rust-byteorder.spec @@ -5,22 +5,23 @@ %global crate byteorder Name: rust-%{crate} -Version: 1.1.0 +Version: 1.2.1 Release: 1%{?dist} Summary: Library for reading/writing numbers in big-endian and little-endian License: Unlicense or MIT URL: https://crates.io/crates/byteorder Source0: https://crates.io/api/v1/crates/%{crate}/%{version}/download#/%{crate}-%{version}.crate -# https://github.com/BurntSushi/byteorder/pull/104 -Patch0: 0001-Fix-prop_ext_-u-int_-native_endian-on-BE-targets.patch +# Initial patched metadata +# * Bump quickcheck to 0.5, https://github.com/BurntSushi/byteorder/pull/109 +Patch0: byteorder-1.2.1-fix-metadata.diff ExclusiveArch: %{rust_arches} BuildRequires: rust-packaging %if %{with check} # [dev-dependencies] -BuildRequires: (crate(quickcheck) >= 0.4.0 with crate(quickcheck) < 0.5.0) +BuildRequires: (crate(quickcheck) >= 0.5.0 with crate(quickcheck) < 0.6.0) BuildRequires: (crate(rand) >= 0.3.0 with crate(rand) < 0.4.0) %endif @@ -58,6 +59,9 @@ which use %{crate} from crates.io. %{cargo_registry}/%{crate}-%{version}/ %changelog +* Thu Nov 30 2017 Igor Gnatenko - 1.2.1-1 +- Update to 1.2.1 + * Fri Nov 10 2017 Igor Gnatenko - 1.1.0-1 - Update to 1.1.0 diff --git a/sources b/sources index 4ec3f91..3f796b2 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (byteorder-1.1.0.crate) = 610c77c91fa3c23699d28d78631b87e6d4c56ad9754dabfb640f9ac4a41a2925c1a44c34988654bdcd4b02a3474ddf374d98999f6d53bed68835360d288b9922 +SHA512 (byteorder-1.2.1.crate) = 3b8822286a3973ef80309f30e169dee5fd87d98a0b4f5a44da7e29c2f14f5ce47a9f109087c84cab09078ad0c3507bb459bac243528bf4d8eae7a958394a4041