c4850973e42ba9b5427c436ff97a48092f2df420
[openwrt/svn-archive/archive.git] / utils / pciutils / patches / 102-zcat-pciids.patch
1 --- a/update-pciids.sh
2 +++ b/update-pciids.sh
3 @@ -6,9 +6,8 @@ set -e
4 SRC="http://pciids.sourceforge.net/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,6 @@ fi
15 if [ -n "$PCI_COMPRESSED_IDS" ] ; then
16 DECOMP="cat"
17 SRC="$SRC.gz"
18 - GREP=zgrep
19 elif which bzip2 >/dev/null 2>&1 ; then
20 DECOMP="bzip2 -d"
21 SRC="$SRC.bz2"
22 @@ -53,7 +51,7 @@ if ! $DECOMP <$DEST.new >$DEST.neww ; th
23 exit 1
24 fi
25
26 -if ! $GREP >/dev/null "^C " $DEST.neww ; then
27 +if ! zcat $DEST.neww | grep >/dev/null "^C " ; then
28 echo >&2 "update-pciids: missing class info, probably truncated file"
29 exit 1
30 fi