usbutils: update to 010

This commit is contained in:
Juergen Daubert 2018-05-17 11:04:45 +02:00
parent 83b5b412c8
commit 4b96c2301a
6 changed files with 157 additions and 12 deletions

View File

@ -4,9 +4,6 @@ drwxr-xr-x root/root usr/bin/
-rwxr-xr-x root/root usr/bin/lsusb.py
-rwxr-xr-x root/root usr/bin/usb-devices
-rwxr-xr-x root/root usr/bin/usbhid-dump
drwxr-xr-x root/root usr/lib/
drwxr-xr-x root/root usr/lib/pkgconfig/
-rw-r--r-- root/root usr/lib/pkgconfig/usbutils.pc
drwxr-xr-x root/root usr/share/
drwxr-xr-x root/root usr/share/man/
drwxr-xr-x root/root usr/share/man/man1/

View File

@ -1,2 +1,3 @@
19ab63529b086d08151886943bc7adfb usb.ids.xz
a7cf9e8903041987efa5e5e0080e0b4d usbutils-009.tar.xz
abbe452593c29a9a27da9a37f8c87510 lsusb.py.patch
15923fcc07d5b496a7f449cb126629dd usb.ids.xz
938e3707593974be99a0dd6d1de76671 usbutils-010.tar.xz

View File

@ -1,6 +1,7 @@
untrusted comment: verify with /etc/ports/core.pub
RWRJc1FUaeVequFqojkwsL+QvycX3oSJt8VK+fvXD47kujHUl194x6GCX5BdT5rVEbhWRxrmEburjVJ2UZZ58aYsRLMvQp8XXgU=
SHA256 (Pkgfile) = 42fb6b6320fd9622e4bf3aaad55157801021e8d898d5d2f6ef46209a5bfed073
SHA256 (.footprint) = 21494efbc2e45e61b623a6971bc947aded879ee933adba115a98e78ad837463b
SHA256 (usbutils-009.tar.xz) = 8bbff0e54cb5f65a52be4feb9162fc0b022a97eb841b44784f7a89a9ea567160
SHA256 (usb.ids.xz) = a080110c2068f64db66ff54d1564b261e785fecc4a4ecd9453cca8e35490b7ca
RWRJc1FUaeVeqkYLGWezT7GX0D2GphQF/qh1QptxjkgNt4RSFznA8ZgMGXDPKy1pYn07kMaZBLYFpqSZrKtJFePqeY6/ig+fsgo=
SHA256 (Pkgfile) = 58fce641d9bf9e3439e211dce45ac3f95877e403d2146723be3831d69e356000
SHA256 (.footprint) = f82a9d98226269f143bad33baff4bd73c5473e19c9dea2792382c13d1bc44b34
SHA256 (usbutils-010.tar.xz) = 61c7364bb4986fb05e5067e4ac5585b1299b664c57f761caecd2e9e724794a19
SHA256 (lsusb.py.patch) = d509a72aa47445e86722ad8b7419400858af1ff2cc08bce23a9276dd46428f06
SHA256 (usb.ids.xz) = 270ca62f1df3f30f7c4bdd30d29345cc42dccc1b8a12aff31a6c4e9cda4b1c06

View File

@ -4,13 +4,14 @@
# Depends on: libusb
name=usbutils
version=009
version=010
release=1
source=(http://www.kernel.org/pub/linux/utils/usb/$name/$name-$version.tar.xz
usb.ids.xz)
lsusb.py.patch usb.ids.xz)
build() {
cd $name-$version
patch -p1 -i $SRC/lsusb.py.patch
./configure --prefix=/usr --disable-zlib
make
make DESTDIR=$PKG install

145
usbutils/lsusb.py.patch Normal file
View File

@ -0,0 +1,145 @@
From a7c25eadbc998bf359e5b7dac03aaea8c30d2932 Mon Sep 17 00:00:00 2001
From: Georg Brandl <georg@python.org>
Date: Thu, 17 May 2018 08:51:27 +0200
Subject: [PATCH] lsusb.py: fix up Python 3 conversion
- Use open() and ignore encoding errors
- Replace removed __cmp__ by rich comparison methods
- Convert commented-out print statements, remove unused future import
Fixes #68
---
lsusb.py.in | 50 ++++++++++++++++++++++----------------------------
1 file changed, 22 insertions(+), 28 deletions(-)
diff --git a/lsusb.py.in b/lsusb.py.in
index 0f4d318..083b512 100644
--- a/lsusb.py.in
+++ b/lsusb.py.in
@@ -12,8 +12,6 @@
import os, sys, re, getopt
-# from __future__ import print_function
-
# Global options
showint = False
showhubint = False
@@ -53,15 +51,12 @@ class UsbClass:
self.desc = str
def __repr__(self):
return self.desc
- def __cmp__(self, oth):
- # Works only on 64bit systems:
- #return self.pclass*0x10000+self.subclass*0x100+self.proto \
- # - oth.pclass*0x10000-oth.subclass*0x100-oth.proto
- if self.pclass != oth.pclass:
- return self.pclass - oth.pclass
- if self.subclass != oth.subclass:
- return self.subclass - oth.subclass
- return self.proto - oth.proto
+ def __lt__(self, oth):
+ return (self.pclass, self.subclass, self.proto) < \
+ (oth.pclass, oth.subclass, oth.proto)
+ def __eq__(self, oth):
+ return (self.pclass, self.subclass, self.proto) == \
+ (oth.pclass, oth.subclass, oth.proto)
class UsbVendor:
"Container for USB Vendors"
@@ -70,8 +65,10 @@ class UsbVendor:
self.vname = vname
def __repr__(self):
return self.vname
- def __cmp__(self, oth):
- return self.vid - oth.vid
+ def __lt__(self, oth):
+ return self.vid < oth.vid
+ def __eq__(self, oth):
+ return self.vid == oth.vid
class UsbProduct:
"Container for USB VID:PID devices"
@@ -81,13 +78,10 @@ class UsbProduct:
self.pname = pname
def __repr__(self):
return self.pname
- def __cmp__(self, oth):
- # Works only on 64bit systems:
- # return self.vid*0x10000 + self.pid \
- # - oth.vid*0x10000 - oth.pid
- if self.vid != oth.vid:
- return self.vid - oth.vid
- return self.pid - oth.pid
+ def __lt__(self, oth):
+ return (self.vid, self.pid) < (oth.vid, oth.pid)
+ def __eq__(self, oth):
+ return (self.vid, self.pid) == (oth.vid, oth.pid)
usbvendors = []
usbproducts = []
@@ -107,7 +101,7 @@ def parse_usb_ids():
mode = 0
strg = ""
cstrg = ""
- for ln in file(usbids, "r").readlines():
+ for ln in open(usbids, "r", errors="ignore"):
if ln[0] == '#':
continue
ln = ln.rstrip('\n')
@@ -146,7 +140,7 @@ def parse_usb_ids():
def bin_search(first, last, item, list):
"binary search on list, returns -1 on fail, match idx otherwise, recursive"
- #print "bin_search(%i,%i)" % (first, last)
+ #print("bin_search(%i,%i)" % (first, last))
if first == last:
return -1
if first == last-1:
@@ -233,7 +227,7 @@ def find_dev(driver, usbname):
for nm in devlst:
dir = prefix + usbname
prep = ""
- #print nm
+ #print(nm)
idx = nm.find('/')
if idx != -1:
prep = nm[:idx+1]
@@ -404,8 +398,8 @@ class UsbDevice:
try:
self.nointerfaces = int(readattr(fname, "bNumInterfaces"))
except:
- #print "ERROR: %s/bNumInterfaces = %s" % (fname,
- # readattr(fname, "bNumInterfaces"))a
+ #print("ERROR: %s/bNumInterfaces = %s" % (fname,
+ # readattr(fname, "bNumInterfaces")))
self.nointerfaces = 0
try:
self.driver = readlink(fname, "driver")
@@ -421,7 +415,7 @@ class UsbDevice:
for dirent in os.listdir(prefix + self.fname):
if not dirent[0:1].isdigit():
continue
- #print dirent
+ #print(dirent)
if os.access(prefix + dirent + "/bInterfaceClass", os.R_OK):
iface = UsbInterface(self, self.level+1)
iface.read(dirent)
@@ -532,7 +526,7 @@ def usage():
def read_usb():
"Read toplevel USB entries and print"
for dirent in os.listdir(prefix):
- #print dirent,
+ #print(dirent)
if not dirent[0:3] == "usb":
continue
usbdev = UsbDevice(None, 0)
@@ -590,7 +584,7 @@ def main(argv):
fix_usbclass()
except:
print(" WARNING: Failure to read usb.ids", file=sys.stderr)
- #print >>sys.stderr, sys.exc_info()
+ #print(sys.exc_info(), file=sys.stderr)
read_usb()
# Entry point

Binary file not shown.