From d3020eab78c95b9e02feb373ebfd772e9c44df2f Mon Sep 17 00:00:00 2001 From: Jan Beich Date: Sat, 4 Feb 2017 07:41:56 +0000 Subject: devel/py-libusb1: update to 1.6.4 devel/py-adb stays on the old version due to google/python-adb#36 Changes: https://pypi.python.org/pypi/libusb1#id60 --- devel/py-libusb1/files/patch-usb1.py | 26 ----------------------- devel/py-libusb1/files/patch-usb1_____init____.py | 26 +++++++++++++++++++++++ 2 files changed, 26 insertions(+), 26 deletions(-) delete mode 100644 devel/py-libusb1/files/patch-usb1.py create mode 100644 devel/py-libusb1/files/patch-usb1_____init____.py (limited to 'devel/py-libusb1/files') diff --git a/devel/py-libusb1/files/patch-usb1.py b/devel/py-libusb1/files/patch-usb1.py deleted file mode 100644 index a47c742bd960..000000000000 --- a/devel/py-libusb1/files/patch-usb1.py +++ /dev/null @@ -1,26 +0,0 @@ -https://lists.freebsd.org/pipermail/freebsd-usb/2015-January/013586.html - ---- usb1.py.orig 2015-08-15 17:59:35 UTC -+++ usb1.py -@@ -1729,15 +1729,20 @@ class USBDevice(object): - """ - Get device's port number. - """ -- return libusb1.libusb_get_port_number(self.device_p) -+ try: -+ return libusb1.libusb_get_port_number(self.device_p) -+ except AttributeError: -+ return 0 - - def getPortNumberList(self): - """ - Get the port number of each hub toward device. - """ - port_list = (c_uint8 * PATH_MAX_DEPTH)() -+ temp_handle = self.open() - result = libusb1.libusb_get_port_numbers( - self.device_p, port_list, len(port_list)) -+ temp_handle.close() - mayRaiseUSBError(result) - return list(port_list[:result]) - diff --git a/devel/py-libusb1/files/patch-usb1_____init____.py b/devel/py-libusb1/files/patch-usb1_____init____.py new file mode 100644 index 000000000000..e42cf7f83290 --- /dev/null +++ b/devel/py-libusb1/files/patch-usb1_____init____.py @@ -0,0 +1,26 @@ +https://lists.freebsd.org/pipermail/freebsd-usb/2015-January/013586.html + +--- usb1/__init__.py.orig 2016-11-23 13:07:52 UTC ++++ usb1/__init__.py +@@ -1830,15 +1830,20 @@ class USBDevice(object): + """ + Get device's port number. + """ +- return libusb1.libusb_get_port_number(self.device_p) ++ try: ++ return libusb1.libusb_get_port_number(self.device_p) ++ except AttributeError: ++ return 0 + + def getPortNumberList(self): + """ + Get the port number of each hub toward device. + """ + port_list = (c_uint8 * PATH_MAX_DEPTH)() ++ temp_handle = self.open() + result = libusb1.libusb_get_port_numbers( + self.device_p, port_list, len(port_list)) ++ temp_handle.close() + mayRaiseUSBError(result) + return list(port_list[:result]) + -- cgit v1.2.3