summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2005-11-30 06:40:14 +0000
committerMike Frysinger <vapier@gentoo.org>2005-11-30 06:40:14 +0000
commite541a923d0ba6b58601c669090593a8f303925c1 (patch)
treef4e671296f1f00ef66ed527b2a3947833e8231cd /sys-apps/usbutils
parentStable on x86; bug #112840 (diff)
downloadgentoo-2-e541a923d0ba6b58601c669090593a8f303925c1.tar.gz
gentoo-2-e541a923d0ba6b58601c669090593a8f303925c1.tar.bz2
gentoo-2-e541a923d0ba6b58601c669090593a8f303925c1.zip
Add support for newer format types in usb ids file with patch from upstream cvs #111781.
(Portage version: 2.0.53_rc7)
Diffstat (limited to 'sys-apps/usbutils')
-rw-r--r--sys-apps/usbutils/ChangeLog9
-rw-r--r--sys-apps/usbutils/files/digest-usbutils-0.71-r11
-rw-r--r--sys-apps/usbutils/files/usbutils-0.71-new-video-format.patch83
-rw-r--r--sys-apps/usbutils/usbutils-0.71-r1.ebuild49
4 files changed, 141 insertions, 1 deletions
diff --git a/sys-apps/usbutils/ChangeLog b/sys-apps/usbutils/ChangeLog
index 58dd5b0cf769..8176d75be30f 100644
--- a/sys-apps/usbutils/ChangeLog
+++ b/sys-apps/usbutils/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for sys-apps/usbutils
# Copyright 1999-2005 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/usbutils/ChangeLog,v 1.38 2005/07/12 03:45:34 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/usbutils/ChangeLog,v 1.39 2005/11/30 06:40:14 vapier Exp $
+
+*usbutils-0.71-r1 (30 Nov 2005)
+
+ 30 Nov 2005; Mike Frysinger <vapier@gentoo.org>
+ +files/usbutils-0.71-new-video-format.patch, +usbutils-0.71-r1.ebuild:
+ Add support for newer format types in usb ids file with patch from upstream
+ cvs #111781.
*usbutils-0.71 (12 Jul 2005)
diff --git a/sys-apps/usbutils/files/digest-usbutils-0.71-r1 b/sys-apps/usbutils/files/digest-usbutils-0.71-r1
new file mode 100644
index 000000000000..53fcaeb741e9
--- /dev/null
+++ b/sys-apps/usbutils/files/digest-usbutils-0.71-r1
@@ -0,0 +1 @@
+MD5 479d7c7098ef44cc95e7978fd71c712c usbutils-0.71.tar.gz 163811
diff --git a/sys-apps/usbutils/files/usbutils-0.71-new-video-format.patch b/sys-apps/usbutils/files/usbutils-0.71-new-video-format.patch
new file mode 100644
index 000000000000..dfcc00a4c94b
--- /dev/null
+++ b/sys-apps/usbutils/files/usbutils-0.71-new-video-format.patch
@@ -0,0 +1,83 @@
+Handle new entry types in usb.ids
+
+Patch taken from upstream cvs
+
+http://bugs.gentoo.org/111781
+
+--- usbutils/names.c
++++ usbutils/names.c
+@@ -79,6 +79,12 @@
+ char name[1];
+ };
+
++struct videoterminal {
++ struct videoterminal *next;
++ u_int16_t termt;
++ char name[1];
++};
++
+ struct genericstrtable {
+ struct genericstrtable *next;
+ unsigned int num;
+@@ -109,6 +115,7 @@
+ static struct subclass *subclasses[HASHSZ] = { NULL, };
+ static struct protocol *protocols[HASHSZ] = { NULL, };
+ static struct audioterminal *audioterminals[HASHSZ] = { NULL, };
++static struct videoterminal *videoterminals[HASHSZ] = { NULL, };
+ static struct genericstrtable *hiddescriptors[HASHSZ] = { NULL, };
+ static struct genericstrtable *reports[HASHSZ] = { NULL, };
+ static struct genericstrtable *huts[HASHSZ] = { NULL, };
+@@ -356,6 +374,25 @@
+ return 0;
+ }
+
++static int new_videoterminal(const char *name, u_int16_t termt)
++{
++ struct videoterminal *vt;
++ unsigned int h = hashnum(termt);
++
++ vt = videoterminals[h];
++ for (; vt; vt = vt->next)
++ if (vt->termt == termt)
++ return -1;
++ vt = malloc(sizeof(struct videoterminal) + strlen(name));
++ if (!vt)
++ return -1;
++ strcpy(vt->name, name);
++ vt->termt = termt;
++ vt->next = videoterminals[h];
++ videoterminals[h] = vt;
++ return 0;
++}
++
+ static int new_genericstrtable(struct genericstrtable *t[HASHSZ], const char *name, unsigned int index)
+ {
+ struct genericstrtable *g;
+@@ -564,6 +601,27 @@
+ DBG(printf("line %5u audio terminal type %02x %s\n", linectr, u, cp));
+ continue;
+ }
++ if (buf[0] == 'V' && buf[1] == 'T' && isspace(buf[2])) {
++ /* video terminal type spec */
++ cp = buf+3;
++ while (isspace(*cp))
++ cp++;
++ if (!isxdigit(*cp)) {
++ fprintf(stderr, "Invalid video terminal type at line %u\n", linectr);
++ continue;
++ }
++ u = strtoul(cp, &cp, 16);
++ while (isspace(*cp))
++ cp++;
++ if (!*cp) {
++ fprintf(stderr, "Invalid video terminal type at line %u\n", linectr);
++ continue;
++ }
++ if (new_videoterminal(cp, u))
++ fprintf(stderr, "Duplicate video terminal type spec at line %u terminal type %04x %s\n", linectr, u, cp);
++ DBG(printf("line %5u video terminal type %02x %s\n", linectr, u, cp));
++ continue;
++ }
+ if (buf[0] == 'H' && buf[1] == 'C' && buf[2] == 'C' && isspace(buf[3])) {
+ /* HID Descriptor bCountryCode */
+ cp = buf+3;
diff --git a/sys-apps/usbutils/usbutils-0.71-r1.ebuild b/sys-apps/usbutils/usbutils-0.71-r1.ebuild
new file mode 100644
index 000000000000..593d2aa39f41
--- /dev/null
+++ b/sys-apps/usbutils/usbutils-0.71-r1.ebuild
@@ -0,0 +1,49 @@
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/usbutils/usbutils-0.71-r1.ebuild,v 1.1 2005/11/30 06:40:14 vapier Exp $
+
+inherit eutils
+
+DESCRIPTION="USB enumeration utilities"
+HOMEPAGE="http://linux-usb.sourceforge.net/"
+SRC_URI="mirror://sourceforge/linux-usb/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86"
+IUSE=""
+
+DEPEND="dev-libs/libusb"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+
+ # put usb.ids in same place as pci.ids (/usr/share/misc)
+ sed -i \
+ -e 's:/usr/share/usb.ids:/usr/share/misc/usb.ids:' \
+ lsusb.8 || die "sed lsusb.8"
+ sed -e '/^DEST=/s:=usb.ids:=/usr/share/misc/usb.ids:' \
+ update-usbids.sh > update-usbids
+
+ epatch "${FILESDIR}"/${P}-new-video-format.patch #111781
+
+ # replace usb.ids with an updated version
+ ebegin "Updating usb.ids"
+ ./update-usbids.sh &> /dev/null
+ eend 0
+}
+
+src_compile() {
+ econf \
+ --datadir=/usr/share/misc \
+ --enable-usbmodules \
+ || die "./configure failed"
+ emake || die "make failed"
+}
+
+src_install() {
+ make DESTDIR="${D}" install || die "install failed"
+ dosbin update-usbids || die "update-usbids failed"
+ dodoc AUTHORS ChangeLog NEWS README
+}