4 SRC="http://pciids.sourceforge.net/v2.2/pci.ids"
7 if which bzip2 >/dev/null ; then
10 elif which gzip >/dev/null ; then
17 if which curl >/dev/null ; then
18 DL="curl -o $DEST.new $SRC"
19 elif which wget >/dev/null ; then
20 DL="wget -O $DEST.new $SRC"
21 elif which lynx >/dev/null ; then
22 DL="eval lynx -source $SRC >$DEST.new"
24 echo >&2 "update-pciids: cannot find curl, wget or lynx"
29 echo >&2 "update-pciids: download failed"
34 if ! $DECOMP <$DEST.new >$DEST.neww ; then
35 echo >&2 "update-pciids: decompression failed, probably truncated file"
39 if ! grep >/dev/null "^C " $DEST.neww ; then
40 echo >&2 "update-pciids: missing class info, probably truncated file"
44 if [ -f $DEST ] ; then
46 # --reference is supported only by chmod from GNU file, so let's ignore any errors
47 chmod -f --reference=$DEST.old $DEST.neww 2>/dev/null || true