diff options
author | Martin Mares <mj@ucw.cz> | 2020-12-06 19:19:11 +0100 |
---|---|---|
committer | Martin Mares <mj@ucw.cz> | 2020-12-06 19:19:11 +0100 |
commit | 4b7283cc408a79ee829fa01f204358d6329dd063 (patch) | |
tree | b34b613830cf771b7804764208c318c62429937e | |
parent | 89e90b56d7f8cb10f4ba60ed3bcd9c289d11eee7 (diff) | |
parent | b6a0091e4a17dcc01c84dfe233e861fe6e82b1c4 (diff) | |
download | pciutils-4b7283cc408a79ee829fa01f204358d6329dd063.tar.gz |
Merge branch 'pu/update-pciids' of https://github.com/guillemj/pciutils
-rwxr-xr-x | update-pciids.sh | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/update-pciids.sh b/update-pciids.sh index 2e24120..3ea4690 100755 --- a/update-pciids.sh +++ b/update-pciids.sh @@ -1,13 +1,14 @@ #!/bin/sh -[ "$1" = "-q" ] && quiet=true || quiet=false - set -e + SRC="https://pci-ids.ucw.cz/v2.2/pci.ids" DEST=pci.ids PCI_COMPRESSED_IDS= GREP=grep +[ "$1" = "-q" ] && quiet=true || quiet=false + # if pci.ids is read-only (because the filesystem is read-only), # then just skip this whole process. if ! touch ${DEST} >/dev/null 2>&1 ; then @@ -31,7 +32,7 @@ fi if which curl >/dev/null 2>&1 ; then DL="curl -o $DEST.new $SRC" - ${quiet} && DL="$DL -s -S" + ${quiet} && DL="$DL -s -S" elif which wget >/dev/null 2>&1 ; then DL="wget --no-timestamping -O $DEST.new $SRC" ${quiet} && DL="$DL -q" @@ -59,7 +60,7 @@ if ! $GREP >/dev/null "^C " $DEST.neww ; then fi if [ -f $DEST ] ; then - mv $DEST $DEST.old + ln -f $DEST $DEST.old # --reference is supported only by chmod from GNU file, so let's ignore any errors chmod -f --reference=$DEST.old $DEST.neww 2>/dev/null || true fi |