From 12bdd1e0dd5b1969da5ea9c9acd78434ed049353 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Dec 04 2017 15:20:59 +0000 Subject: Update to 0.8.0 Signed-off-by: Igor Gnatenko --- diff --git a/.gitignore b/.gitignore index 7c8ea9e..2c99a4a 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /scroll-0.7.0.crate +/scroll-0.8.0.crate diff --git a/0001-build-make-tests-more-robust-on-various-architecture.patch b/0001-build-make-tests-more-robust-on-various-architecture.patch deleted file mode 100644 index 51ef644..0000000 --- a/0001-build-make-tests-more-robust-on-various-architecture.patch +++ /dev/null @@ -1,156 +0,0 @@ -From 39e05345064ec1783f58a14ce896d521ef3cfc3a Mon Sep 17 00:00:00 2001 -From: m4b -Date: Sat, 2 Dec 2017 00:56:46 -0800 -Subject: [PATCH] build: make tests more robust on various architectures for - smaller pointers + different endianness. ref #20 - ---- - src/greater.rs | 10 +++++----- - src/lesser.rs | 6 +++--- - src/lib.rs | 5 ++++- - tests/api.rs | 12 ++++++------ - 4 files changed, 18 insertions(+), 15 deletions(-) - -diff --git a/src/greater.rs b/src/greater.rs -index 99560b1..cffdbbf 100644 ---- a/src/greater.rs -+++ b/src/greater.rs -@@ -60,7 +60,7 @@ pub trait Cread : Index + Index> - /// use scroll::Cread; - /// - /// let bytes = [0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0xef,0xbe,0x00,0x00,]; -- /// let foo = bytes.cread::(0); -+ /// let foo = bytes.cread::(0); - /// let bar = bytes.cread::(8); - /// assert_eq!(foo, 1); - /// assert_eq!(bar, 0xbeef); -@@ -108,9 +108,9 @@ pub trait Cwrite: Index + IndexMut> { - /// ``` - /// use scroll::{Cwrite, Cread}; - /// let mut bytes = [0x0; 0x10]; -- /// bytes.cwrite::(42, 0); -+ /// bytes.cwrite::(42, 0); - /// bytes.cwrite::(0xdeadbeef, 8); -- /// assert_eq!(bytes.cread::(0), 42); -+ /// assert_eq!(bytes.cread::(0), 42); - /// assert_eq!(bytes.cread::(8), 0xdeadbeef); - #[inline] - fn cwrite>>::Output>>(&mut self, n: N, offset: I) where Ctx: Default { -@@ -124,9 +124,9 @@ pub trait Cwrite: Index + IndexMut> { - /// ``` - /// use scroll::{Cwrite, Cread, LE, BE}; - /// let mut bytes = [0x0; 0x10]; -- /// bytes.cwrite_with::(42, 0, LE); -+ /// bytes.cwrite_with::(42, 0, LE); - /// bytes.cwrite_with::(0xdeadbeef, 8, BE); -- /// assert_eq!(bytes.cread::(0), 42); -+ /// assert_eq!(bytes.cread::(0), 42); - /// assert_eq!(bytes.cread::(8), 0xefbeadde); - #[inline] - fn cwrite_with>>::Output>>(&mut self, n: N, offset: I, ctx: Ctx) { -diff --git a/src/lesser.rs b/src/lesser.rs -index 1258216..a26042a 100644 ---- a/src/lesser.rs -+++ b/src/lesser.rs -@@ -15,13 +15,13 @@ use ctx::{FromCtx, IntoCtx, SizeWith}; - /// - /// #[repr(packed)] - /// struct Foo { --/// foo: usize, -+/// foo: i64, - /// bar: u32, - /// } - /// - /// impl ctx::FromCtx for Foo { - /// fn from_ctx(bytes: &[u8], ctx: scroll::Endian) -> Self { --/// Foo { foo: bytes.pread_with::(0, ctx).unwrap(), bar: bytes.pread_with::(8, ctx).unwrap() } -+/// Foo { foo: bytes.pread_with::(0, ctx).unwrap(), bar: bytes.pread_with::(8, ctx).unwrap() } - /// } - /// } - /// -@@ -35,7 +35,7 @@ use ctx::{FromCtx, IntoCtx, SizeWith}; - /// - /// let bytes_ = [0x0b,0x0b,0x00,0x00,0x00,0x00,0x00,0x00, 0xef,0xbe,0x00,0x00,]; - /// let mut bytes = Cursor::new(bytes_); --/// let foo = bytes.ioread::().unwrap(); -+/// let foo = bytes.ioread::().unwrap(); - /// let bar = bytes.ioread::().unwrap(); - /// assert_eq!(foo, 0xb0b); - /// assert_eq!(bar, 0xbeef); -diff --git a/src/lib.rs b/src/lib.rs -index 2f9ecda..4311485 100644 ---- a/src/lib.rs -+++ b/src/lib.rs -@@ -78,7 +78,7 @@ - //! let mut bytes = Cursor::new(bytes_); - //! - //! // this will bump the cursor's Seek --//! let foo = bytes.ioread::().unwrap(); -+//! let foo = bytes.ioread::().unwrap(); - //! // ..ditto - //! let bar = bytes.ioread::().unwrap(); - //! ``` -@@ -222,7 +222,10 @@ mod tests { - let bytes: [u8; 2] = [0x7e, 0xef]; - let b = &bytes[..]; - let byte: u16 = b.pread(0).unwrap(); -+ #[cfg(target_endian = "little")] - assert_eq!(0xef7e, byte); -+ #[cfg(target_endian = "big")] -+ assert_eq!(0x7eef, byte); - } - - #[test] -diff --git a/tests/api.rs b/tests/api.rs -index e3d8574..942d5af 100644 ---- a/tests/api.rs -+++ b/tests/api.rs -@@ -171,13 +171,13 @@ fn lifetime_passthrough() { - #[derive(Default)] - #[repr(packed)] - struct Foo { -- foo: usize, -+ foo: i64, - bar: u32, - } - - impl scroll::ctx::FromCtx for Foo { - fn from_ctx(bytes: &[u8], ctx: scroll::Endian) -> Self { -- Foo { foo: bytes.cread_with::(0, ctx), bar: bytes.cread_with::(8, ctx) } -+ Foo { foo: bytes.cread_with::(0, ctx), bar: bytes.cread_with::(8, ctx) } - } - } - -@@ -194,7 +194,7 @@ fn ioread_api() { - use scroll::IOread; - let bytes_ = [0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0xef,0xbe,0x00,0x00,]; - let mut bytes = Cursor::new(bytes_); -- let foo = bytes.ioread::().unwrap(); -+ let foo = bytes.ioread::().unwrap(); - let bar = bytes.ioread::().unwrap(); - assert_eq!(foo, 1); - assert_eq!(bar, 0xbeef); -@@ -223,7 +223,7 @@ impl scroll::ctx::FromCtx for Bar { - fn cread_api() { - use scroll::Cread; - let bytes = [0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0xef,0xbe,0x00,0x00,]; -- let foo = bytes.cread::(0); -+ let foo = bytes.cread::(0); - let bar = bytes.cread::(8); - assert_eq!(foo, 1); - assert_eq!(bar, 0xbeef); -@@ -251,9 +251,9 @@ fn cwrite_api() { - use scroll::Cwrite; - use scroll::Cread; - let mut bytes = [0x0; 0x10]; -- bytes.cwrite::(42, 0); -+ bytes.cwrite::(42, 0); - bytes.cwrite::(0xdeadbeef, 8); -- assert_eq!(bytes.cread::(0), 42); -+ assert_eq!(bytes.cread::(0), 42); - assert_eq!(bytes.cread::(8), 0xdeadbeef); - } - --- -2.15.1 - diff --git a/rust-scroll.spec b/rust-scroll.spec index 6785fbd..2849eed 100644 --- a/rust-scroll.spec +++ b/rust-scroll.spec @@ -5,22 +5,19 @@ %global crate scroll Name: rust-%{crate} -Version: 0.7.0 +Version: 0.8.0 Release: 1%{?dist} Summary: Powerful, extensible, generic, endian-aware Read/Write traits for byte buffers License: MIT URL: https://crates.io/crates/scroll Source0: https://crates.io/api/v1/crates/%{crate}/%{version}/download#/%{crate}-%{version}.crate -# Initial patched metadata -# * Bump rayon to 0.9, https://github.com/m4b/scroll/commit/2b8ec1ccbf64fc0fa09cced9e9590186bc0c059e -Patch0: scroll-0.7.0-fix-metadata.diff -# https://github.com/m4b/scroll/commit/39e05345064ec1783f58a14ce896d521ef3cfc3a -Patch1: 0001-build-make-tests-more-robust-on-various-architecture.patch ExclusiveArch: %{rust_arches} BuildRequires: rust-packaging +# [dependencies] +BuildRequires: (crate(scroll_derive) >= 0.8.0 with crate(scroll_derive) < 0.9.0) %if %{with check} # [dev-dependencies] BuildRequires: (crate(byteorder) >= 1.0.0 with crate(byteorder) < 2.0.0) @@ -53,14 +50,7 @@ which use %{crate} from crates.io. %if %{with check} %check -# https://github.com/m4b/scroll/issues/20 -# Tests are failing on BE, but because they are written that way. -%cargo_test \ - %ifarch ppc64 s390x - || : - %else - ; - %endif +%cargo_test %endif %files devel @@ -69,5 +59,8 @@ which use %{crate} from crates.io. %{cargo_registry}/%{crate}-%{version}/ %changelog +* Mon Dec 04 2017 Igor Gnatenko - 0.8.0-1 +- Update to 0.8.0 + * Fri Dec 01 2017 Igor Gnatenko - 0.7.0-1 - Initial package diff --git a/scroll-0.7.0-fix-metadata.diff b/scroll-0.7.0-fix-metadata.diff deleted file mode 100644 index 5560da4..0000000 --- a/scroll-0.7.0-fix-metadata.diff +++ /dev/null @@ -1,11 +0,0 @@ ---- scroll-0.7.0/Cargo.toml 1970-01-01T01:00:00+01:00 -+++ scroll-0.7.0/Cargo.toml 2017-12-01T15:47:19.695643+01:00 -@@ -24,7 +24,7 @@ - version = "1.0.0" - - [dev-dependencies.rayon] --version = "0.8.0" -+version = "0.9.0" - - [features] - std = [] diff --git a/sources b/sources index bea3322..7ca8125 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (scroll-0.7.0.crate) = 503ac57116128dc560ef48b8928d74aa14c77b3e8d1de189030d8528c7a6294866726fad1490741b775a424ddb5584af60c66983684d8aaa043fd8fc1f36d26b +SHA512 (scroll-0.8.0.crate) = 56c2d9e3f7fdd442e49c0eb7ee205eb8af2e110cb781e973fb5244fca45ca546a30861114bdcf985ee7c173d7e72536f250ef40a5ad2f6acbffb4099a89b0f47