The package rpms/rust-podio.git has added or updated architecture specific content in its
spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s):
https://src.fedoraproject.org/cgit/rpms/rust-podio.git/commit/?id=af288c0....
Change:
-%ifnarch s390x
Thanks.
Full change:
============
commit af288c0fe83ca50e42df935cbeae4af6b8f03e8b
Author: Igor Raits <ignatenkobrain(a)fedoraproject.org>
Date: Thu May 28 16:57:34 2020 +0200
Fix code on big endian
Signed-off-by: Igor Raits <ignatenkobrain(a)fedoraproject.org>
diff --git a/0001-Fix-endianness-conversion-on-big-endian-platforms.patch
b/0001-Fix-endianness-conversion-on-big-endian-platforms.patch
new file mode 100644
index 0000000..ce5ac5c
--- /dev/null
+++ b/0001-Fix-endianness-conversion-on-big-endian-platforms.patch
@@ -0,0 +1,80 @@
+From 9c34e58b57ce2c55e2c31c93149edfa7057d25db Mon Sep 17 00:00:00 2001
+From: Mathijs van de Nes <git(a)mathijs.vd-nes.nl>
+Date: Thu, 28 May 2020 16:36:23 +0200
+Subject: [PATCH] Fix endianness conversion on big-endian platforms
+
+I have to admit that the code does not really make a lot of sense
+anymore. But to avoid breaking the API, I have published this fix. A new
+major release will be published which has a more sane API.
+
+The problem was that val_to_buf would always convert a value to
+little-endian, not to native-endian. As on x86 native=little, this would
+not be an issue. But when native=big, we would first convert the values
+to little-endian, but assume the value would be big-endian encoded.
+---
+ src/lib.rs | 28 ++++++++++++++++++++++++++++
+ 1 file changed, 28 insertions(+)
+
+diff --git a/src/lib.rs b/src/lib.rs
+index 30c8d05..a080334 100644
+--- a/src/lib.rs
++++ b/src/lib.rs
+@@ -188,6 +188,7 @@ impl_platform_convert!(u16);
+ impl_platform_convert!(u32);
+ impl_platform_convert!(u64);
+
++#[cfg(target_endian = "little")]
+ macro_rules! val_to_buf {
+ ($val:ident, $T:expr) => {
+ {
+@@ -200,6 +201,19 @@ macro_rules! val_to_buf {
+ };
+ }
+
++#[cfg(target_endian = "big")]
++macro_rules! val_to_buf {
++ ($val:ident, $T:expr) => {
++ {
++ let mut buf = [0; $T];
++ for i in 0..buf.len() {
++ buf[buf.len() - 1 - i] = ($val >> (i * 8)) as u8;
++ }
++ buf
++ }
++ };
++}
++
+ impl<W: Write> WritePodExt for W {
+ fn write_u64<T: Endianness>(&mut self, val: u64) ->
io::Result<()> {
+ let tval = <T as Endianness>::int_to_target(val);
+@@ -264,6 +278,7 @@ fn fill_buf<R: Read>(reader: &mut R, buf: &mut [u8])
-> io::Result<()> {
+ Ok(())
+ }
+
++#[cfg(target_endian = "little")]
+ macro_rules! buf_to_val {
+ ($buf:ident, $T:ty) => {
+ {
+@@ -276,6 +291,19 @@ macro_rules! buf_to_val {
+ };
+ }
+
++#[cfg(target_endian = "big")]
++macro_rules! buf_to_val {
++ ($buf:ident, $T:ty) => {
++ {
++ let mut val: $T = 0;
++ for i in 0..$buf.len() {
++ val |= ($buf[$buf.len() - 1 - i] as $T) << (i * 8);
++ }
++ val
++ }
++ };
++}
++
+ impl<R: Read> ReadPodExt for R {
+ fn read_u64<T: Endianness>(&mut self) -> io::Result<u64> {
+ let buf = &mut [0u8; 8];
+--
+2.26.2
+
diff --git a/rust-podio.spec b/rust-podio.spec
index 2d37ebe..120e246 100644
--- a/rust-podio.spec
+++ b/rust-podio.spec
@@ -1,25 +1,20 @@
-# Generated by rust2rpm 13
-
-%ifnarch s390x
+# Generated by rust2rpm 15
%bcond_without check
-%else
-#
https://github.com/mvdnes/podio/issues/4
-%bcond_with check
-%endif
-
%global debug_package %{nil}
%global crate podio
Name: rust-%{crate}
Version: 0.1.6
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: Additional trait for Read and Write to read and write Plain Old Data
# Upstream license specification: MIT OR Apache-2.0
License: MIT or ASL 2.0
URL:
https://crates.io/crates/podio
Source: %{crates_source}
+#
https://github.com/mvdnes/podio/commit/9c34e58b57ce2c55e2c31c93149edfa705...
+Patch0001: 0001-Fix-endianness-conversion-on-big-endian-platforms.patch
ExclusiveArch: %{rust_arches}
%if %{__cargo_skip_build}
@@ -78,5 +73,8 @@ which use "default" feature of "%{crate}" crate.
%endif
%changelog
+* Thu May 28 16:56:41 CEST 2020 Igor Raits <ignatenkobrain(a)fedoraproject.org> -
0.1.6-2
+- Fix code on big endian
+
* Sat May 23 13:28:34 PDT 2020 Michel Alexandre Salim <salimma(a)fedoraproject.org> -
0.1.6-1
- Initial package