From 711f32cfb9c58050d9583ad6e5ff28c16da1944e Mon Sep 17 00:00:00 2001 From: TNE Date: Mon, 25 Apr 2022 20:43:42 +0200 Subject: [PATCH] [2.6.2] improve garuda pacman hook optimization --- PKGBUILD | 4 ++-- garuda-common-settings.install | 12 ++++++++++++ .../system/garuda-pacman-snapshot-reject.service | 2 +- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/PKGBUILD b/PKGBUILD index 07f6517..060a12a 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -2,8 +2,8 @@ # Maintainer: Librewish pkgname=garuda-common-settings -pkgver=2.6.1 -pkgrel=3 +pkgver=2.6.2 +pkgrel=1 arch=('any') url="https://gitlab.com/garuda-linux/themes-and-settings/settings/$pkgname" license=('GPL') diff --git a/garuda-common-settings.install b/garuda-common-settings.install index fa47c9d..1cbbbc2 100644 --- a/garuda-common-settings.install +++ b/garuda-common-settings.install @@ -10,6 +10,14 @@ post_install() { } +pre_upgrade() { + if [[ $(vercmp 2.6.3 $2) -gt 0 ]] && [[ $(vercmp 2.5.8 $2) -lt 0 ]]; then + umount /usr/share/libalpm/hooks/01-snapshot-reject.hook + # Not technically necessary + ln -s /dev/null /etc/pacman.d/hooks/01-snapshot-reject.hook + fi +} + post_upgrade() { echo "Performing misc postinstall operations..." mkfontscale /usr/share/fonts/TTF /usr/share/fonts/OTF /usr/share/fonts/misc > /dev/null 2>&1 @@ -24,3 +32,7 @@ post_upgrade() { systemctl enable garuda-pacman-snapshot-reject fi } + +post_remove() { + rm -f /etc/pacman.d/hooks/01-snapshot-reject.hook +} diff --git a/usr/lib/systemd/system/garuda-pacman-snapshot-reject.service b/usr/lib/systemd/system/garuda-pacman-snapshot-reject.service index 0640fac..7104150 100644 --- a/usr/lib/systemd/system/garuda-pacman-snapshot-reject.service +++ b/usr/lib/systemd/system/garuda-pacman-snapshot-reject.service @@ -3,7 +3,7 @@ Description=Optimizing pacman hooks [Service] Type=oneshot -ExecStart=bash -c "/usr/lib/garuda/is-snapshot-boot || mount --bind /dev/null /usr/share/libalpm/hooks/01-snapshot-reject.hook" +ExecStart=bash -c "if /usr/lib/garuda/is-snapshot-boot; then rm -f /etc/pacman.d/hooks/01-snapshot-reject.hook; else ln -fs /dev/null /etc/pacman.d/hooks/01-snapshot-reject.hook; fi" [Install] WantedBy=multi-user.target