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