[packages/libafdt] Rel 9
arekm
arekm at pld-linux.org
Mon Mar 9 23:50:10 CET 2026
commit bdae9be061face8baad7a343ba940db9fc7b2961
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date: Mon Mar 9 23:49:43 2026 +0100
Rel 9
libafdt.spec | 9 ++++--
tests-python3-compat.patch | 70 ++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 76 insertions(+), 3 deletions(-)
---
diff --git a/libafdt.spec b/libafdt.spec
index 6f4e5fe..9e43b8c 100644
--- a/libafdt.spec
+++ b/libafdt.spec
@@ -7,13 +7,15 @@
Summary: LIBrary for Asynchronous File Descriptor Transfer
Name: libafdt
Version: 0.1.0
-Release: 6
+Release: 9
License: BSD
Group: Libraries
-Source0: http://downloads.sourceforge.net/libafdt/%{name}-%{version}.tar.gz
+Source0: https://downloads.sourceforge.net/libafdt/%{name}-%{version}.tar.gz
# Source0-md5: 8051b4e88c5804ce34e221cb62c5e672
-URL: http://facebook.github.io/libafdt/
+URL: https://facebook.github.io/libafdt/
Patch0: %{name}-link.patch
+# Python 3 test harness compatibility
+Patch1: tests-python3-compat.patch
BuildRequires: autoconf
BuildRequires: automake
%{?with_apidocs:BuildRequires: doxygen}
@@ -69,6 +71,7 @@ Dokumentacja API biblioteki libafdt.
%prep
%setup -q
%patch -P0 -p1
+%patch -P1 -p1
%build
%{__libtoolize}
diff --git a/tests-python3-compat.patch b/tests-python3-compat.patch
new file mode 100644
index 0000000..c161e1e
--- /dev/null
+++ b/tests-python3-compat.patch
@@ -0,0 +1,70 @@
+--- libafdt-0.1.0/test/runtests.py.orig 2009-10-24 18:23:16.000000000 +0200
++++ libafdt-0.1.0/test/runtests.py 2026-03-10 00:06:00.000000000 +0100
+@@ -8,9 +8,15 @@
+ import subprocess
+ import errno
+ import signal
+-import urllib2
++try:
++ import urllib.request as urllib2
++except ImportError:
++ import urllib2
+ import threading
+-import Queue
++try:
++ import queue as Queue
++except ImportError:
++ import Queue
+
+
+
+@@ -37,7 +43,7 @@
+ try:
+ if proc is not None:
+ os.kill(proc.pid, signal.SIGTERM)
+- except OSError, err:
++ except OSError as err:
+ if err.errno != errno.ESRCH:
+ traceback.print_exc()
+
+@@ -75,7 +81,7 @@
+ def openurl(port, path):
+ with contextlib.closing(urllib2.urlopen(
+ "http://localhost:%d/%s" % (port, path))) as handle:
+- return handle.read()
++ return handle.read().decode("ascii")
+
+ def checkret(port, path, content):
+ self.assertEqual(openurl(port, path), content)
+@@ -176,7 +182,7 @@
+ # The second server should receive the socket quickly
+ self.assertEqual(q.get(timeout=1.0/16), "afdt")
+ t.join(1.0/16)
+- self.assertFalse(t.isAlive())
++ self.assertFalse(t.is_alive())
+ # Close the socket on the first server
+ checkret(self.port0, "close_prod", "closed")
+ # Verify that the second is listening
+@@ -220,7 +226,7 @@
+ self.clproc = subprocess.Popen(PREFIX +
+ ["./" + self.client], stdin=subprocess.PIPE)
+ time.sleep(1.0/4)
+- self.clproc.stdin.write("TEST1")
++ self.clproc.stdin.write(b"TEST1")
+ time.sleep(1.0/4)
+
+ # Remove the signal handler
+@@ -228,11 +234,11 @@
+ # Let the server exit
+ time.sleep(1.0/2)
+
+- self.clproc.stdin.write("TEST2")
++ self.clproc.stdin.write(b"TEST2")
+ self.clproc.stdin.close()
+ time.sleep(1.0/4)
+
+- self.assertEqual(self.svproc.stdout.read(), "TEST1TEST2")
++ self.assertEqual(self.svproc.stdout.read(), b"TEST1TEST2")
+
+ # Make sure they both go down in a reasonable time
+ # TODO(dreiss): Factor out subprocs?
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/libafdt.git/commitdiff/bdae9be061face8baad7a343ba940db9fc7b2961
More information about the pld-cvs-commit
mailing list