102-compressed-ids.patch 893 B

12345678910111213141516171819202122232425262728293031
  1. --- a/update-pciids.sh
  2. +++ b/update-pciids.sh
  3. @@ -6,9 +6,8 @@ set -e
  4. SRC="http://pci-ids.ucw.cz/v2.2/pci.ids"
  5. DEST=pci.ids
  6. PCI_COMPRESSED_IDS=
  7. -GREP=grep
  8. -# if pci.ids is read-only (because the filesystem is read-only),
  9. +# if pci.ids.gz is read-only (because the filesystem is read-only),
  10. # then just skip this whole process.
  11. if ! touch ${DEST} >/dev/null 2>&1 ; then
  12. ${quiet} || echo "${DEST} is read-only, exiting." 1>&2
  13. @@ -18,7 +17,7 @@ fi
  14. if [ "$PCI_COMPRESSED_IDS" = 1 ] ; then
  15. DECOMP="cat"
  16. SRC="$SRC.gz"
  17. - GREP=zgrep
  18. + DEST="$DEST.gz"
  19. elif which bzip2 >/dev/null 2>&1 ; then
  20. DECOMP="bzip2 -d"
  21. SRC="$SRC.bz2"
  22. @@ -53,7 +52,7 @@ if ! $DECOMP <$DEST.new >$DEST.neww ; th
  23. exit 1
  24. fi
  25. -if ! $GREP >/dev/null "^C " $DEST.neww ; then
  26. +if ! zcat $DEST.neww | grep >/dev/null "^C " ; then
  27. echo >&2 "update-pciids: missing class info, probably truncated file"
  28. exit 1
  29. fi