From 2a967858214489f49587f0b2c375dbcf7541cf88 Mon Sep 17 00:00:00 2001 From: Thomas Duckworth Date: Fri, 21 Nov 2025 18:27:08 +1100 Subject: [PATCH] Unduplicate udev package cleanup code Two backup directories for each package don't need to exist. Combine them into the one. --- mkosi.finalize.d/40-core.sh.chroot | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/mkosi.finalize.d/40-core.sh.chroot b/mkosi.finalize.d/40-core.sh.chroot index 271b8c1..7a7a703 100755 --- a/mkosi.finalize.d/40-core.sh.chroot +++ b/mkosi.finalize.d/40-core.sh.chroot @@ -21,18 +21,11 @@ if [ -f "$SRCDIR/.secure_files/gpg.public.key" ]; then # only useful and availab # https://invent.kde.org/kde-linux/kde-linux/-/issues/199 fi -# Uninstall solaar, but keep its udev rules. +# Uninstall solaar and sane, but keep their udev rules. # This ensures that they stay up to date. UDEV_BACKUP_DIR=$(mktemp -d) -pacman -Qlq solaar | grep '^/usr/lib/udev/' | xargs -r cp -a --parents -t "$UDEV_BACKUP_DIR" -pacman -Rns --noconfirm solaar - -# Uninstall sane, but keep its udev rules. -# This ensures that they stay up to date. -UDEV_BACKUP_DIR=$(mktemp -d) -pacman -Qlq sane | grep '^/usr/lib/udev/' | xargs -r cp -a --parents -t "$UDEV_BACKUP_DIR" -pacman -Rns --noconfirm sane - +pacman -Qlq solaar sane | grep '^/usr/lib/udev/' | xargs -r cp -a --parents -t "$UDEV_BACKUP_DIR" +pacman -Rns --noconfirm solaar sane cp -a "$UDEV_BACKUP_DIR"/* / rm -rf "$UDEV_BACKUP_DIR"