Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-packaging for 
openSUSE:Factory checked in at 2022-05-30 12:42:20
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-packaging (Old)
 and      /work/SRC/openSUSE:Factory/.python-packaging.new.2254 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-packaging"

Mon May 30 12:42:20 2022 rev:24 rq:979721 version:21.3

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-packaging/python-packaging.changes        
2022-04-26 20:17:12.216719668 +0200
+++ 
/work/SRC/openSUSE:Factory/.python-packaging.new.2254/python-packaging.changes  
    2022-05-30 12:42:37.696284955 +0200
@@ -1,0 +2,6 @@
+Sun May 29 09:22:42 UTC 2022 - John Paul Adrian Glaubitz 
<adrian.glaub...@suse.com>
+
+- Add patch to fix testsuite on big-endian targets
+  + fix-big-endian-build.patch
+
+-------------------------------------------------------------------

New:
----
  fix-big-endian-build.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-packaging.spec ++++++
--- /var/tmp/diff_new_pack.LTZbBC/_old  2022-05-30 12:42:38.332285801 +0200
+++ /var/tmp/diff_new_pack.LTZbBC/_new  2022-05-30 12:42:38.340285812 +0200
@@ -37,6 +37,9 @@
 Source:         
https://files.pythonhosted.org/packages/source/p/packaging/packaging-%{version}.tar.gz
 # Restore compatibility with 20.4 for setuptools
 Patch1:         no-legacyversion-warning.patch
+# Fix testsuite on big-endian systems
+# see: https://github.com/pypa/packaging/pull/538
+Patch2:         fix-big-endian-build.patch
 BuildRequires:  %{python_module devel}
 BuildRequires:  fdupes
 BuildRequires:  python-rpm-macros

++++++ fix-big-endian-build.patch ++++++
>From efb42e3a40c4e1ea043902b0ac989af9af5dedbb Mon Sep 17 00:00:00 2001
From: Tzu-ping Chung <uranu...@gmail.com>
Date: Wed, 20 Apr 2022 10:00:07 +0800
Subject: [PATCH] Correctly parse ELF for musllinux on Big Endian

Always use LSB to parse binary in tests
---
 packaging/_musllinux.py | 8 +++++---
 tests/test_musllinux.py | 9 +++++----
 2 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/packaging/_musllinux.py b/packaging/_musllinux.py
index 8ac3059..d5d3e04 100644
--- a/packaging/_musllinux.py
+++ b/packaging/_musllinux.py
@@ -39,9 +39,11 @@ def _parse_ld_musl_from_elf(f: IO[bytes]) -> Optional[str]:
         # p_fmt: Format for section header.
         # p_idx: Indexes to find p_type, p_offset, and p_filesz.
         e_fmt, p_fmt, p_idx = {
-            1: ("IIIIHHH", "IIIIIIII", (0, 1, 4)),  # 32-bit.
-            2: ("QQQIHHH", "IIQQQQQQ", (0, 2, 5)),  # 64-bit.
-        }[ident[4]]
+            (1, 1): ("<IIIIHHH", "<IIIIIIII", (0, 1, 4)),  # 32-bit LSB.
+            (1, 2): (">IIIIHHH", ">IIIIIIII", (0, 1, 4)),  # 32-bit MSB.
+            (2, 1): ("<QQQIHHH", "<IIQQQQQQ", (0, 2, 5)),  # 64-bit LSB.
+            (2, 2): (">QQQIHHH", ">IIQQQQQQ", (0, 2, 5)),  # 64-bit MSB.
+        }[(ident[4], ident[5])]
     except KeyError:
         return None
     else:
diff --git a/tests/test_musllinux.py b/tests/test_musllinux.py
index d2c87ca..2623bdb 100644
--- a/tests/test_musllinux.py
+++ b/tests/test_musllinux.py
@@ -101,14 +101,15 @@ def test_parse_ld_musl_from_elf_no_interpreter_section():
     with BIN_MUSL_X86_64.open("rb") as f:
         data = f.read()
 
-    # Change all sections to *not* PT_INTERP.
-    unpacked = struct.unpack("16BHHIQQQIHHH", data[:58])
+    # Change all sections to *not* PT_INTERP. We are explicitly using LSB rules
+    # because the binaries are in LSB.
+    unpacked = struct.unpack("<16BHHIQQQIHHH", data[:58])
     *_, e_phoff, _, _, _, e_phentsize, e_phnum = unpacked
     for i in range(e_phnum + 1):
         sb = e_phoff + e_phentsize * i
         se = sb + 56
-        section = struct.unpack("IIQQQQQQ", data[sb:se])
-        data = data[:sb] + struct.pack("IIQQQQQQ", 0, *section[1:]) + data[se:]
+        section = struct.unpack("<IIQQQQQQ", data[sb:se])
+        data = data[:sb] + struct.pack("<IIQQQQQQ", 0, *section[1:]) + 
data[se:]
 
     assert _parse_ld_musl_from_elf(io.BytesIO(data)) is None
 
-- 
2.36.1

Reply via email to