[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

RC bugfix for pyusb / #515207



Hi Release Team!

Unfortunately a bug which breaks pyusb on 64bit arches and Python 2.5 only, was
not noticed until now. So I'd like to upload a patched version to
stable-proposed-updates. Hope that's ok :)
I've attached a debdiff between -4 and -5 (which was uploaded to unstable right
now), please let me know if it is ok to use that for stable, or if I should
remove the changes to Uploaders/Vcs/Standards-Version in d/control.

Thanks,

Bernd
-- 
 Bernd Zeimetz                           Debian GNU/Linux Developer
 GPG Fingerprint: 06C8 C9A2 EAAD E37E 5B2C BE93 067A AD04 C93B FF79
diff -u pyusb-0.4.1/debian/control pyusb-0.4.1/debian/control
--- pyusb-0.4.1/debian/control
+++ pyusb-0.4.1/debian/control
@@ -2,13 +2,12 @@
 Section: python
 Priority: optional
 Maintainer: Debian Python Modules Team <python-modules-team@lists.alioth.debian.org>
-Uploaders: Petter Reinholdtsen <pere@debian.org>, Bernd Zeimetz <bzed@debian.org>,
- Piotr Ożarowski <piotr@debian.org>
-Build-Depends: debhelper (>= 5), cdbs  (>=0.4.41), libusb-dev, python-all-dev, python-support (>= 0.3)
+Uploaders: Petter Reinholdtsen <pere@debian.org>, Bernd Zeimetz <bzed@debian.org>
+Build-Depends: debhelper (>= 5), cdbs  (>=0.4.41), libusb-dev, python-all-dev, python-support (>= 0.3), dpatch
 Standards-Version: 3.8.0
 Homepage: http://pyusb.berlios.de/
 Vcs-Svn: svn://svn.debian.org/python-modules/packages/pyusb/trunk/
-Vcs-Browser: http://svn.debian.org/wsvn/python-modules/packages/pyusb/trunk/?op=log
+Vcs-Browser: http://svn.debian.org/viewsvn/python-modules/packages/pyusb/trunk/
 
 Package: python-usb
 Architecture: any
diff -u pyusb-0.4.1/debian/changelog pyusb-0.4.1/debian/changelog
--- pyusb-0.4.1/debian/changelog
+++ pyusb-0.4.1/debian/changelog
@@ -1,3 +1,27 @@
+pyusb (0.4.1-5) unstable; urgency=medium
+
+  [ Piotr Ożarowski ]
+  * Remove myself from uploaders.
+
+  [ Sandro Tosi ]
+  * debian/control
+    - switch Vcs-Browser field to viewsvn
+
+  [ Bernd Zeimetz ]
+  * debian/control:
+    - adding dpatch to Build-Depends
+    - Removing Petter Reinholdtsen from Uploaders
+  * debian/rules:
+    - adding dpatch include for cdbs.
+  * debian/patches:
+    - adding patch from Thomas Viehmann - thanks for that:
+      * Don't pass int* where we need Py_ssize_t*.
+        Breaks (overwriting parameters) for python 2.5 on 64 bit arch.
+        Needs the usual PEP353 compatibility bruhaha plus printf.
+      (Closes: #515207)
+
+ -- Bernd Zeimetz <bzed@debian.org>  Sun, 15 Feb 2009 22:06:00 +0100
+
 pyusb (0.4.1-4) unstable; urgency=low
 
   [ Piotr Ożarowski ]
diff -u pyusb-0.4.1/debian/rules pyusb-0.4.1/debian/rules
--- pyusb-0.4.1/debian/rules
+++ pyusb-0.4.1/debian/rules
@@ -2,6 +2,7 @@
 
 DEB_PYTHON_SYSTEM = pysupport
 
+include /usr/share/cdbs/1/rules/dpatch.mk
 include /usr/share/cdbs/1/rules/debhelper.mk
 include /usr/share/cdbs/1/class/python-distutils.mk
 
only in patch2:
unchanged:
--- pyusb-0.4.1.orig/debian/patches/00dpatch.conf
+++ pyusb-0.4.1/debian/patches/00dpatch.conf
@@ -0,0 +1,2 @@
+conf_debianonly=1
+conf_origtargzpath=../tarballs
only in patch2:
unchanged:
--- pyusb-0.4.1.orig/debian/patches/PEP353_compat_fix.dpatch
+++ pyusb-0.4.1/debian/patches/PEP353_compat_fix.dpatch
@@ -0,0 +1,71 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## PEP353_compat_fix.dpatch by Thomas Viehmann
+##
+## DP: * Don't pass int* where we need Py_ssize_t*.
+## DP:   Breaks (overwriting parameters) for python 2.5 on 64 bit arch.
+## DP:   Needs the usual PEP353 compatibility bruhaha plus printf.
+
+@DPATCH@
+diff -urNad pyusb~/pyusb.c pyusb/pyusb.c
+--- pyusb~/pyusb.c	2007-09-28 23:46:58.000000000 +0200
++++ pyusb/pyusb.c	2009-02-15 21:33:15.000000000 +0100
+@@ -13,6 +13,14 @@
+ #include <stdio.h>
+ #define DEFAULT_TIMEOUT 100
+ 
++/* see PEP353 */
++#if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN)
++typedef int Py_ssize_t;
++# define PY_SSIZE_T_MAX INT_MAX
++# define PY_SSIZE_T_MIN INT_MIN
++# define PY_FORMAT_SIZE_T ""
++#endif
++
+ /*
+  * Necessary to compile successfully in python 2.3
+  * Thanks to Mark Rages for the patch
+@@ -126,7 +134,7 @@
+  */
+ PYUSB_STATIC char *getBuffer(
+ 	PyObject *obj,
+-	int *size
++	Py_ssize_t *size
+ 	)
+ {
+ 	char *p = NULL;
+@@ -1104,7 +1112,7 @@
+ 	int index = 0;
+ 	char *bytes;
+ 	PyObject *data;
+-	int size;
++	Py_ssize_t size;
+ 	int timeout = DEFAULT_TIMEOUT;
+ 	int ret;
+ 	int as_read = 0;
+@@ -1162,7 +1170,7 @@
+ 		   timeout);
+ 
+ 	if (as_read) {
+-		fprintf(stderr, "\tbuffer: %d\n", size);
++		fprintf(stderr, "\tbuffer: %" PY_FORMAT_SIZE_T "d\n", size);
+ 	} else {
+ 		fprintf(stderr, "controlMsg buffer param:\n");
+ 		printBuffer(bytes, size);
+@@ -1386,7 +1394,7 @@
+ 	int endpoint;
+ 	int timeout = DEFAULT_TIMEOUT;
+ 	char *data;
+-	int size;
++	Py_ssize_t size;
+ 	PyObject *bytes;
+ 	int ret;
+ 	PyObject *retObj;
+@@ -1493,7 +1501,7 @@
+ 	int endpoint;
+ 	int timeout = DEFAULT_TIMEOUT;
+ 	char *data;
+-	int size;
++	Py_ssize_t size;
+ 	PyObject *bytes;
+ 	int ret;
+ 	PyObject *retObj;
only in patch2:
unchanged:
--- pyusb-0.4.1.orig/debian/patches/00list
+++ pyusb-0.4.1/debian/patches/00list
@@ -0,0 +1 @@
+PEP353_compat_fix.dpatch

Reply to: