From: Guillem Jover Date: Wed, 23 Sep 2020 17:56:57 +0000 (+0200) Subject: update-pciids: Make the backup with a hardlink instead of a move X-Git-Tag: v3.8.0~104^2 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=b6a0091e4a17dcc01c84dfe233e861fe6e82b1c4;p=pciutils.git update-pciids: Make the backup with a hardlink instead of a move If we move the file while making a backup, we can end up with no pci.ids database in case the next step fails. --- diff --git a/update-pciids.sh b/update-pciids.sh index 42faeea..3ea4690 100755 --- a/update-pciids.sh +++ b/update-pciids.sh @@ -60,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