summaryrefslogtreecommitdiff
path: root/sys-apps/usbutils
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2018-07-21 19:10:49 +0100
committerV3n3RiX <venerix@redcorelinux.org>2018-07-21 19:10:49 +0100
commit9c0a2358763d5637ca11fe0d263ff4c9fca70a9e (patch)
tree04e08cca47b10c4c36569536eada5756eabfebf5 /sys-apps/usbutils
parent963e79dcc85b2d1ff6167b5558b885d19cb0a6ad (diff)
gentoo resync : 21.07.2018
Diffstat (limited to 'sys-apps/usbutils')
-rw-r--r--sys-apps/usbutils/Manifest3
-rw-r--r--sys-apps/usbutils/files/usbutils-010-fix-py3-support.patch145
-rw-r--r--sys-apps/usbutils/usbutils-010-r1.ebuild (renamed from sys-apps/usbutils/usbutils-010.ebuild)4
3 files changed, 150 insertions, 2 deletions
diff --git a/sys-apps/usbutils/Manifest b/sys-apps/usbutils/Manifest
index 952a7e008bee..d0564d2df28a 100644
--- a/sys-apps/usbutils/Manifest
+++ b/sys-apps/usbutils/Manifest
@@ -1,8 +1,9 @@
AUX usbutils-006-stdint.patch 701 BLAKE2B 511a0466d35f452c48bf6490415f1fdc3925fc2b613cd9f0f1d29258afae1e8fb03a5c6ea0ec9a1606b227af1e3e8160f07959b281a1e62d7115779a80779ab8 SHA512 8854846ec60652490401932a751e1e7ea61f59afa83447dd976ac351f898418777780b5e240c76771580aa8a879dbb63928adc053a3a95649dde5d9fab52798a
+AUX usbutils-010-fix-py3-support.patch 4251 BLAKE2B 46cb941e30da1b3b9f1a346bba5815485b6423578175b999a57475e6e2d917da9ce4a80943c74b84ce8488d6cbf1461010d4866d5e4813945e04d8b5aa0b5e8c SHA512 652824dcea10591ba74769703f60f49a3fb592e7cd5435756804c200cee45e9c9a818c6d6a4d3b315ba3b9e2dfa7314f94f870b2da768f6e887348b1aa5597f6
DIST usbutils-008.tar.xz 287052 BLAKE2B eb9b998adb69938d004828585f782840e34f453327de54a32c563268db22a870fd7298cf839692e58ae42148e63037260e09bc2f1d5700ff96bcc451aff626ba SHA512 ab1ad36467ff79ff5ab0b924620001612cae44def58c05ade01a4e58d8a4d48df61c09faba49a20497b7d6314045bbaf137b51a9f4e6b65ed0ea3bb339bf1c45
DIST usbutils-009.tar.xz 309608 BLAKE2B bb5d7f756241377e81aa8f5b074bb0ba36bc778698afaebf7054cdb153149e4f3808a7b172019434756cae8b33410643cd6a03a36277f80ead9b0f4446385fd9 SHA512 e5936a42615690c13e618655fc5eb4f414d9a84f85b860eaeb3bcf737258e05d299b09d1c5388d50c718626036ec8cac5d670ad567ceadfaab85f401f0744a8a
DIST usbutils-010.tar.xz 308344 BLAKE2B 5f0ba85564acaf60faad0e187e7ed5c870056cf80a1e1ae888fa498429a7a9e28eaced49047f8f793bad3c59f3b515557054860286b17d9f89f915d0db5943cc SHA512 8bc197307bc34b38c406c58c939be32f0b20ce9d3e7c977472fe4c3d47e791765432e381fd8d7393df621bbd4bf159ca24a08b22441770e7ae464e767f99a2e3
EBUILD usbutils-008-r1.ebuild 1244 BLAKE2B 65d0f771202bf1e39d243c6f46d3f45d818033b7bd40ba198e834038416498a68e329c7182ec0ba756479ee6bd54aac11556e4513b44baa98c0dcee320b1801a SHA512 5384707b65c9801744ec1838e94396ee421ea007ec25c5afc1503134c2d7bf0231fdd1d9dce8b6af9892177b1dbe16b30303c810bb4e1d82b2082c2f32fe5964
EBUILD usbutils-009.ebuild 1144 BLAKE2B 9fa4c45b9b706633f9f967468f4d6115c4d37310e6b9fa7d39c3a58a7f60a56fdb0039fabcd4e6c442927c5a18bfc0a0173b017617130265821ccc1c3a3f225a SHA512 40cf6c93e23f33e46c8111fc17e00c9a57b457c4ccf260188ac4b12f4f524d9f8d43e206f27bb72f954ee7f4506034516cf15ed477fa8cf81aa5e262768455d8
-EBUILD usbutils-010.ebuild 1204 BLAKE2B 5ba8ce207ceeec0297ec554ec40c288f77eb6973926648294535fa2c63997fb8f5d9b4efb64700c891399f2421e814ee44819f791f232b6596b45b38b8e82679 SHA512 671d130588c07e24c793b4cc8d929c390baeec46001b2344e2c09cd862fa1bad9445a22292be54a98d762047cf782a0cc60f4de43fec650d9763f6b4143fcb2a
+EBUILD usbutils-010-r1.ebuild 1260 BLAKE2B b70011975310485c999a46e1815ec7f70bfe66cd30561b9b85ed6632bf711882f5b2ef5fa00c3a9b1106ba4bf6e59fdd833be2eacb784737aa42a7f207c2306a SHA512 94105a54e8691baa33702375dcdc117a870b0dcb32e60b499db0ae91ae1aeec8f6b324a0b58266297fb2dec7106e6d1183fdf3701b7e8b973767ab427ffa234c
MISC metadata.xml 253 BLAKE2B 295e9d6d93aaa12af413972e1590c67087801cc09c9aa6b59d4606c0f4106d1dacf2baa9858559083b4c6d91beeef218d0729e8593a33788958da6d2897e8ce2 SHA512 54a9069aeb4165d2dff3d473c8001bc51613aac9dff3f7f5e9971a9891a737a31511ffa11cbd523febe581ac1d9de2bdf2f40410f0c4239138f2ccca3ef15555
diff --git a/sys-apps/usbutils/files/usbutils-010-fix-py3-support.patch b/sys-apps/usbutils/files/usbutils-010-fix-py3-support.patch
new file mode 100644
index 000000000000..c95bb7321b85
--- /dev/null
+++ b/sys-apps/usbutils/files/usbutils-010-fix-py3-support.patch
@@ -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
diff --git a/sys-apps/usbutils/usbutils-010.ebuild b/sys-apps/usbutils/usbutils-010-r1.ebuild
index 7ae5f0e8c309..37260497e7d2 100644
--- a/sys-apps/usbutils/usbutils-010.ebuild
+++ b/sys-apps/usbutils/usbutils-010-r1.ebuild
@@ -2,7 +2,7 @@
# Distributed under the terms of the GNU General Public License v2
EAPI=6
-PYTHON_COMPAT=( python3_{4,5,6} )
+PYTHON_COMPAT=( python3_{4,5,6,7} )
inherit python-single-r1
@@ -26,6 +26,8 @@ RDEPEND="${CDEPEND}
sys-apps/hwids
python? ( ${PYTHON_DEPS} )"
+PATCHES=( "${FILESDIR}"/${P}-fix-py3-support.patch )
+
pkg_setup() {
use python && python-single-r1_pkg_setup
}