update-pciutils-dist
authorAnas Nashif <anas.nashif@intel.com>
Tue, 6 Nov 2012 17:15:51 +0000 (09:15 -0800)
committerMaciej Wereski <m.wereski@partner.samsung.com>
Tue, 21 Jan 2014 08:52:22 +0000 (09:52 +0100)
Makefile
update-pciids.sh

index 0a21ee80cd83414617f83b8a183f04774cfd05cf..28561a617385407a8ba533519e5963fc90c266ce 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -85,7 +85,7 @@ lspci: LDLIBS+=$(LIBKMOD_LIBS)
 ls-kernel.o: CFLAGS+=$(LIBKMOD_CFLAGS)
 
 update-pciids: update-pciids.sh
-       sed <$< >$@ "s@^DEST=.*@DEST=$(IDSDIR)/$(PCI_IDS)@;s@^PCI_COMPRESSED_IDS=.*@PCI_COMPRESSED_IDS=$(PCI_COMPRESSED_IDS)@"
+       sed <$< >$@ "s@^DEST=.*@DEST=$(IDSDIR)/pci.ids.d/pci.ids.dist@;s@^PCI_COMPRESSED_IDS=.*@PCI_COMPRESSED_IDS=@"
        chmod +x $@
 
 # The example of use of libpci
index ab68d1226c9f0b468c058b31de456a6ed502fb57..0c4d755c053193bf05d78b5b386f644939aec4f3 100755 (executable)
@@ -4,7 +4,7 @@
 
 set -e
 SRC="http://pci-ids.ucw.cz/v2.2/pci.ids"
-DEST=pci.ids
+DEST=pci.ids.d/pci.ids.dist
 PCI_COMPRESSED_IDS=
 GREP=grep
 
@@ -66,6 +66,13 @@ fi
 mv $DEST.neww $DEST
 rm $DEST.new
 
+if [ -x /usr/bin/merge-pciids -a -x /usr/bin/perl ]; then
+       merge-pciids
+else
+       echo "WARNING: merge-pciids or perl missing"
+       cp -p $DEST /usr/share/pci.ids
+fi
+
 # Older versions did not compress the ids file, so let's make sure we
 # clean that up.
 if [ ${DEST%.gz} != ${DEST} ] ; then