]> mj.ucw.cz Git - pciutils.git/commitdiff
update-pciids: Make the backup with a hardlink instead of a move
authorGuillem Jover <guillem@hadrons.org>
Wed, 23 Sep 2020 17:56:57 +0000 (19:56 +0200)
committerGuillem Jover <guillem@hadrons.org>
Wed, 23 Sep 2020 18:02:54 +0000 (20:02 +0200)
If we move the file while making a backup, we can end up with no
pci.ids database in case the next step fails.

update-pciids.sh

index 42faeea13a5af27193669b58dbc8e30ba3fe9c43..3ea46904033356a29a865601f75bd98c44653565 100755 (executable)
@@ -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