diff options
author | William Hubbs <williamh@gentoo.org> | 2012-01-06 04:25:47 +0000 |
---|---|---|
committer | William Hubbs <williamh@gentoo.org> | 2012-01-06 04:25:47 +0000 |
commit | a50346568af58ca06018fe0eca165781607fdc64 (patch) | |
tree | 11a134bdb64165ee0efe2194e7995579b429e8b1 /sys-fs/udev | |
parent | Version bump for stable channel release. (diff) | |
download | gentoo-2-a50346568af58ca06018fe0eca165781607fdc64.tar.gz gentoo-2-a50346568af58ca06018fe0eca165781607fdc64.tar.bz2 gentoo-2-a50346568af58ca06018fe0eca165781607fdc64.zip |
add back the zlib patch for bug #360849 after speaking with ssuominon.
(Portage version: 2.2.0_alpha84/cvs/Linux i686)
Diffstat (limited to 'sys-fs/udev')
-rw-r--r-- | sys-fs/udev/files/udev-175-zlib.patch | 89 | ||||
-rw-r--r-- | sys-fs/udev/udev-175-r1.ebuild | 12 |
2 files changed, 98 insertions, 3 deletions
diff --git a/sys-fs/udev/files/udev-175-zlib.patch b/sys-fs/udev/files/udev-175-zlib.patch new file mode 100644 index 000000000000..fb93bbbfdcbd --- /dev/null +++ b/sys-fs/udev/files/udev-175-zlib.patch @@ -0,0 +1,89 @@ +--- a/extras/usb-db/usb-db.c ++++ b/extras/usb-db/usb-db.c +@@ -90,19 +90,60 @@ + #define HEXCHARS "0123456789abcdefABCDEF" + #define WHITESPACE " \t\n\r" + ++#ifdef USE_ZLIB ++ ++#include <zlib.h> ++ ++static ssize_t gz_getline(char **lineptr, size_t *n, void *stream) ++{ ++ if (!*lineptr) ++ *lineptr = malloc(*n = 4096); ++ if (!*lineptr) ++ return -1; ++ if (gzgets(stream, *lineptr, *n - 1)) { ++ (*lineptr)[*n - 1] = '\0'; ++ /* should return strlen(*lineptr), but caller doesn't care */ ++ return 0; ++ } ++ return -1; ++} ++static int gz_fclose(void *stream) ++{ ++ return gzclose(stream); ++} ++ ++static ssize_t stdio_getline(char **lineptr, size_t *n, void *stream) ++{ ++ return getline(lineptr, n, stream); ++} ++static int stdio_fclose(void *stream) ++{ ++ return fclose(stream); ++} ++ ++#endif ++ + static int lookup_vid_pid( + uint16_t vid, + uint16_t pid, + char **vendor, + char **product) { + +- FILE *f; ++ void *f; + int ret = -1; + int found_vendor = 0; + char *line = NULL; + + *vendor = *product = NULL; + ++#ifdef USE_ZLIB ++ ssize_t (*getline)(char **lineptr, size_t *n, void *stream) = stdio_getline; ++ int (*fclose)(void *stream) = stdio_fclose; ++ if ((f = gzopen(DATABASE ".gz", "r"))) { ++ getline = gz_getline; ++ fclose = gz_fclose; ++ } else ++#endif + if (!(f = fopen(DATABASE, "r"))) { + fprintf(stderr, "Failed to open database file "DATABASE": %s\n", strerror(errno)); + return -1; +@@ -111,11 +152,6 @@ + for (;;) { + size_t n; + +- if (line) { +- free(line); +- line = NULL; +- } +- + if (getline(&line, &n, f) < 0) + break; + +--- a/Makefile.in ++++ b/Makefile.in +@@ -987,7 +987,7 @@ + # ------------------------------------------------------------------------------ + @ENABLE_HWDB_TRUE@extras_usb_db_usb_db_SOURCES = extras/usb-db/usb-db.c +-@ENABLE_HWDB_TRUE@extras_usb_db_usb_db_CPPFLAGS = $(AM_CPPFLAGS) -DUSB_DATABASE=\"$(USB_DATABASE)\" -DBUILD_FOR_USB ++@ENABLE_HWDB_TRUE@extras_usb_db_usb_db_CPPFLAGS = $(AM_CPPFLAGS) -DUSB_DATABASE=\"$(USB_DATABASE)\" -DBUILD_FOR_USB -DUSE_ZLIB +-@ENABLE_HWDB_TRUE@extras_usb_db_usb_db_LDADD = libudev/libudev-private.la ++@ENABLE_HWDB_TRUE@extras_usb_db_usb_db_LDADD = libudev/libudev-private.la -lz + @ENABLE_HWDB_TRUE@extras_usb_db_pci_db_SOURCES = extras/usb-db/usb-db.c +-@ENABLE_HWDB_TRUE@extras_usb_db_pci_db_CPPFLAGS = $(AM_CPPFLAGS) -DPCI_DATABASE=\"$(PCI_DATABASE)\" -DBUILD_FOR_PCI ++@ENABLE_HWDB_TRUE@extras_usb_db_pci_db_CPPFLAGS = $(AM_CPPFLAGS) -DPCI_DATABASE=\"$(PCI_DATABASE)\" -DBUILD_FOR_PCI -DUSE_ZLIB + @ENABLE_HWDB_TRUE@extras_usb_db_pci_db_LDADD = libudev/libudev-private.la diff --git a/sys-fs/udev/udev-175-r1.ebuild b/sys-fs/udev/udev-175-r1.ebuild index b2ffc591143e..0780599cb32d 100644 --- a/sys-fs/udev/udev-175-r1.ebuild +++ b/sys-fs/udev/udev-175-r1.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-fs/udev/udev-175-r1.ebuild,v 1.5 2012/01/04 00:36:37 williamh Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-fs/udev/udev-175-r1.ebuild,v 1.6 2012/01/06 04:25:47 williamh Exp $ EAPI=4 @@ -34,7 +34,7 @@ HOMEPAGE="http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html" LICENSE="GPL-2" SLOT="0" IUSE="build selinux debug +rule_generator hwdb acl gudev introspection - keymap floppy edd doc" + keymap floppy edd doc zlib" COMMON_DEPEND="selinux? ( sys-libs/libselinux ) acl? ( sys-apps/acl dev-libs/glib:2 ) @@ -62,7 +62,11 @@ else fi RDEPEND="${COMMON_DEPEND} - hwdb? ( >=sys-apps/usbutils-0.82 sys-apps/pciutils[-zlib] ) + hwdb? ( + >=sys-apps/usbutils-0.82 + sys-apps/pciutils[zlib=] + zlib? ( sys-libs/zlib ) + ) acl? ( sys-apps/coreutils[acl] ) !sys-apps/coldplug !<sys-fs/lvm2-2.02.45 @@ -132,6 +136,8 @@ src_prepare() EPATCH_FORCE="yes" epatch fi + use hwdb && use zlib && epatch "${FILESDIR}"/${P}-zlib.patch + # change rules back to group uucp instead of dialout for now sed -e 's/GROUP="dialout"/GROUP="uucp"/' \ -i rules/{rules.d,arch}/*.rules \ |