From 8944082ae9095e904a593573373843e5a898ad92 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Fri, 26 Jan 2007 12:54:59 +0000 Subject: [PATCH] - version 2.2.4 - truncate long device names (#205948) - Resolves: rhbz#205948 --- .cvsignore | 2 +- pciutils-2.2.4-buf.patch | 58 +++++++++++++++ pciutils-2.2.4-multilib.patch | 135 ++++++++++++++++++++++++++++++++++ pciutils-strip.patch | 24 +++--- pciutils.spec | 17 +++-- sources | 2 +- 6 files changed, 216 insertions(+), 22 deletions(-) create mode 100644 pciutils-2.2.4-buf.patch create mode 100644 pciutils-2.2.4-multilib.patch diff --git a/.cvsignore b/.cvsignore index e52cff0..220a201 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -pciutils-2.2.3.tar.gz +pciutils-2.2.4.tar.gz diff --git a/pciutils-2.2.4-buf.patch b/pciutils-2.2.4-buf.patch new file mode 100644 index 0000000..9dbd389 --- /dev/null +++ b/pciutils-2.2.4-buf.patch @@ -0,0 +1,58 @@ +--- pciutils-2.2.4/lib/names.c.buf 2006-09-09 12:46:39.000000000 +0200 ++++ pciutils-2.2.4/lib/names.c 2007-01-26 13:47:01.000000000 +0100 +@@ -372,12 +372,27 @@ + res = snprintf(buf, size, "%s", num); + else if (!name) + res = snprintf(buf, size, ((flags & PCI_LOOKUP_MIXED) ? "%s [%s]" : "%s %s"), unknown, num); +- else if (!(flags & PCI_LOOKUP_MIXED)) ++ else if (!(flags & PCI_LOOKUP_MIXED)) + res = snprintf(buf, size, "%s", name); + else + res = snprintf(buf, size, "%s [%s]", name, num); +- if (res < 0 || res >= size) ++ if (res < 0 || res >= size) { ++ if (name && res >= size) { ++ int nlen = strlen(name); ++ if (nlen > (res - size) + 5) { ++ char *nname = strdup(name); ++ int off = nlen - (res - size) - 5; ++ if (nname) { ++ nname[off] = '.'; ++ nname[off+1] = '.'; ++ nname[off+2] = '.'; ++ nname[off+3] = 0; ++ return format_name(buf, size, flags, nname, num, unknown); ++ } ++ } ++ } + return ""; ++ } + else + return buf; + } +@@ -408,8 +423,24 @@ + else /* v && !d */ + res = snprintf(buf, size, "%s Unknown device %s", v, num+5); + } +- if (res < 0 || res >= size) ++ if (res < 0 || res >= size) { ++ if (d && res >= size) { ++ int nlen = strlen(d); ++ if (nlen > (res - size) + 5) { ++ char *nname = strdup(d); ++ int off = nlen - (res - size) - 5; ++ if (nname) { ++ nname[off] = '.'; ++ nname[off+1] = '.'; ++ nname[off+2] = '.'; ++ nname[off+3] = 0; ++ return format_name_pair(buf, size, flags, v, nname, num); ++ } ++ } ++ } ++ + return ""; ++ } + else + return buf; + } diff --git a/pciutils-2.2.4-multilib.patch b/pciutils-2.2.4-multilib.patch new file mode 100644 index 0000000..74d53a7 --- /dev/null +++ b/pciutils-2.2.4-multilib.patch @@ -0,0 +1,135 @@ +--- pciutils-2.2.4/lib/configure.multilib 2006-09-09 13:06:10.000000000 +0200 ++++ pciutils-2.2.4/lib/configure 2007-01-26 13:09:31.000000000 +0100 +@@ -35,74 +35,60 @@ + zlib=$5 + + c=config.h ++cm=config.h.mk + m=config.mk +-echo >$c "#define PCI_ARCH_`echo $cpu | tr 'a-z' 'A-Z'`" +-echo >>$c "#define PCI_OS_`echo $sys | tr 'a-z' 'A-Z'`" +-rm -f $m ++cat >$c <$c "#define PCI_ARCH_`echo $cpu | tr 'a-z' 'A-Z'`" ++#echo >>$c "#define PCI_OS_`echo $sys | tr 'a-z' 'A-Z'`" ++rm -f $cm ++echo >$cm "#define PCI_ARCH_`echo $cpu | tr 'a-z' 'A-Z'`" ++echo >>$cm "#define PCI_OS_`echo $sys | tr 'a-z' 'A-Z'`" + + echo_n "Looking for access methods..." ++echo_n " sysfs proc" + +-case $sys in +- linux*) +- echo_n " sysfs proc" +- echo >>$c '#define PCI_HAVE_PM_LINUX_SYSFS' +- echo >>$c '#define PCI_HAVE_PM_LINUX_PROC' +- echo >>$c '#define PCI_HAVE_LINUX_BYTEORDER_H' +- echo >>$c '#define PCI_PATH_PROC_BUS_PCI "/proc/bus/pci"' +- echo >>$c '#define PCI_PATH_SYS_BUS_PCI "/sys/bus/pci"' +- case $cpu in +- i386) echo_n " i386-ports" +- echo >>$c '#define PCI_HAVE_PM_INTEL_CONF' +- ;; +- esac +- echo >>$c '#define PCI_HAVE_64BIT_ADDRESS' +- ;; +- sunos) +- case $cpu in +- i386) echo_n " i386-ports" +- echo >>$c "#define PCI_HAVE_PM_INTEL_CONF" +- ;; +- *) +- echo " The PCI library is does not support Solaris for this architecture: $cpu" +- exit 1 +- ;; +- esac +- ;; +- freebsd) +- echo_n " fbsd-device" +- echo >>$c '#define PCI_HAVE_PM_FBSD_DEVICE' +- echo >>$c '#define PCI_PATH_FBSD_DEVICE "/dev/pci"' +- ;; +- openbsd) +- echo_n " obsd-device" +- echo >>$c '#define PCI_HAVE_PM_OBSD_DEVICE' +- echo >>$c '#define PCI_PATH_OBSD_DEVICE "/dev/pci"' +- ;; +- aix) +- echo_n " aix-device" +- echo >>$c '#define PCI_HAVE_PM_AIX_DEVICE' +- echo >>$m 'CFLAGS=-g' +- echo >>$m 'INSTALL=installbsd' +- echo >>$m 'DIRINSTALL=mkdir -p' +- ;; +- netbsd) +- echo_n " nbsd-libpci" +- echo >>$c '#define PCI_HAVE_PM_NBSD_LIBPCI' +- echo >>$c '#define PCI_PATH_NBSD_DEVICE "/dev/pci0"' +- echo >>$m 'PCILIB=lib/libpciutils.a' +- echo >>$m 'LDFLAGS+=-lpci' +- ;; +- gnu) +- echo_n " i386-ports" +- echo >>$c '#define PCI_HAVE_PM_INTEL_CONF' +- ;; +- *) +- echo " Unfortunately, your OS is not supported by the PCI Library" +- exit 1 +- ;; ++echo >>$cm '#define PCI_HAVE_PM_LINUX_SYSFS' ++echo >>$cm '#define PCI_HAVE_PM_LINUX_PROC' ++echo >>$cm '#define PCI_HAVE_LINUX_BYTEORDER_H' ++echo >>$cm '#define PCI_PATH_PROC_BUS_PCI "/proc/bus/pci"' ++echo >>$cm '#define PCI_PATH_SYS_BUS_PCI "/sys/bus/pci"' ++case $cpu in ++ i386) echo_n " i386-ports" ++ echo >>$cm '#define PCI_HAVE_PM_INTEL_CONF' ++ ;; + esac ++echo >>$cm '#define PCI_HAVE_64BIT_ADDRESS' ++ + + echo >>$c '#define PCI_HAVE_PM_DUMP' ++echo >>$cm '#define PCI_HAVE_PM_DUMP' + echo " dump" + + echo_n "Checking for zlib support... " +@@ -124,6 +110,8 @@ + echo >>$c '#define PCI_IDS "pci.ids"' + fi + echo >>$c "#define PCI_PATH_IDS_DIR \"$idsdir\"" +- + echo >>$c "#define PCILIB_VERSION \"$version\"" +-sed '/"/{s/^#define \([^ ]*\) "\(.*\)"$/\1=\2/;p;d;};s/^#define \(.*\)/\1=1/' <$c >>$m ++echo >>$cm "#define PCI_PATH_IDS_DIR \"$idsdir\"" ++echo >>$cm "#define PCILIB_VERSION \"$version\"" ++#sed '/"/{s/^#define \([^ ]*\) "\(.*\)"$/\1=\2/;p;d;};s/^#define \(.*\)/\1=1/' <$c >>$m ++sed '/"/{s/^#define \([^ ]*\) "\(.*\)"$/\1=\2/;p;d;};s/^#define \(.*\)/\1=1/' <$cm >>$m diff --git a/pciutils-strip.patch b/pciutils-strip.patch index 19ca22e..faabafb 100644 --- a/pciutils-strip.patch +++ b/pciutils-strip.patch @@ -1,7 +1,7 @@ ---- pciutils-2.1.99-test3/Makefile.strip 2004-02-25 01:46:14.315787866 -0500 -+++ pciutils-2.1.99-test3/Makefile 2004-02-25 01:47:45.478046260 -0500 -@@ -32,7 +32,7 @@ - all: $(PCILIB) lspci setpci lspci.8 setpci.8 update-pciids update-pciids.8 pci.ids +--- pciutils-2.2.4/Makefile.strip 2007-01-26 12:44:56.000000000 +0100 ++++ pciutils-2.2.4/Makefile 2007-01-26 12:43:45.000000000 +0100 +@@ -27,7 +27,7 @@ + all: $(PCILIB) lspci setpci lspci.8 setpci.8 update-pciids update-pciids.8 $(PCI_IDS) $(PCILIB): $(PCIINC) force - $(MAKE) -C lib all @@ -9,14 +9,12 @@ force: ---- pciutils-2.1.99-test8/Makefile.foo 2005-05-10 15:24:45.000000000 -0400 -+++ pciutils-2.1.99-test8/Makefile 2005-05-10 15:24:50.000000000 -0400 -@@ -65,7 +65,7 @@ +@@ -58,7 +58,7 @@ install: all # -c is ignored on Linux, but required on FreeBSD - $(DIRINSTALL) -m 755 $(SBINDIR) $(IDSDIR) $(MANDIR)/man8 -- $(INSTALL) -c -m 755 -s lspci setpci $(SBINDIR) -+ $(INSTALL) -c -m 755 lspci setpci $(SBINDIR) - $(INSTALL) -c -m 755 update-pciids $(SBINDIR) - $(INSTALL) -c -m 644 pci.ids $(IDSDIR) - $(INSTALL) -c -m 644 lspci.8 setpci.8 update-pciids.8 $(MANDIR)/man8 + $(DIRINSTALL) -m 755 $(DESTDIR)$(SBINDIR) $(DESTDIR)$(IDSDIR) $(DESTDIR)$(MANDIR)/man8 +- $(INSTALL) -c -m 755 -s lspci setpci $(DESTDIR)$(SBINDIR) ++ $(INSTALL) -c -m 755 lspci setpci $(DESTDIR)$(SBINDIR) + $(INSTALL) -c -m 755 update-pciids $(DESTDIR)$(SBINDIR) + $(INSTALL) -c -m 644 $(PCI_IDS) $(DESTDIR)$(IDSDIR) + $(INSTALL) -c -m 644 lspci.8 setpci.8 update-pciids.8 $(DESTDIR)$(MANDIR)/man8 diff --git a/pciutils.spec b/pciutils.spec index f68d7b2..c99d9f2 100644 --- a/pciutils.spec +++ b/pciutils.spec @@ -1,15 +1,14 @@ Name: pciutils -Version: 2.2.3 -Release: 4 +Version: 2.2.4 +Release: 1 Source: ftp://atrey.karlin.mff.cuni.cz/pub/linux/pci/%{name}-%{version}.tar.gz Patch0: pciutils-strip.patch +Patch1: pciutils-2.2.4-buf.patch Patch2: pciutils-2.1.10-scan.patch Patch3: pciutils-havepread.patch -Patch5: pciutils-devicetype.patch Patch6: pciutils-2.2.1-idpath.patch Patch7: pciutils-2.1.99-gcc4.patch -Patch8: pciutils-2.2.3-multilib.patch -Patch9: pciutils-2.2.3-sata.patch +Patch8: pciutils-2.2.4-multilib.patch License: GPL URL: http://atrey.karlin.mff.cuni.cz/~mj/pciutils.shtml Buildroot: %{_tmppath}/%{name}-%{version}-root @@ -35,13 +34,12 @@ devices connected to the PCI bus. %prep %setup -q -n pciutils-%{version} %patch0 -p1 -b .strip +%patch1 -p1 -b .buf %patch2 -p1 -b .scan %patch3 -p1 -b .pread -%patch5 -p1 -b .devicetype %patch6 -p1 -b .idpath %patch7 -p1 -b .glibcmacros %patch8 -p1 -b .multilib -%patch9 -p1 -b .sata %build make OPT="$RPM_OPT_FLAGS -D_GNU_SOURCE=1" PREFIX="/usr" IDSDIR="/usr/share/hwdata" @@ -74,6 +72,11 @@ install lib/types.h $RPM_BUILD_ROOT%{_includedir}/pci rm -rf $RPM_BUILD_ROOT %changelog +* Fri Jan 26 2007 Harald Hoyer - 2.2.4-1 +- version 2.2.4 +- truncate long device names (#205948) +- Resolves: rhbz#205948 + * Wed Aug 9 2006 Peter Jones - 2.2.3-4 - Add definitions for more pci storage classes diff --git a/sources b/sources index b40868b..e73c264 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -39747279aad46e7a6a3e1ea636d055b4 pciutils-2.2.3.tar.gz +5629fdb049f189fb853e7021f85553d2 pciutils-2.2.4.tar.gz