From 65c8e0638b90d619ea8450f37af832af9b657fd1 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Tue, 28 Jan 2020 11:16:55 +0100 Subject: act on specific packages on offline action only This adds a configuration file /etc/pacman.d/offline.conf that can be included to global pacman configuration file /etc/pacman.conf. By default it contains configuration to ignore linux packages. On offline action this include is removed, allowing to update linux packages on offline action only. This prevents from breaking module loading in a running system. --- systemd/pacman-offline | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'systemd') diff --git a/systemd/pacman-offline b/systemd/pacman-offline index 3e9133b..39ed094 100755 --- a/systemd/pacman-offline +++ b/systemd/pacman-offline @@ -7,6 +7,11 @@ if [ "$(readlink '/system-update')" != '/var/cache/pacman/pkg' ]; then exit 0 fi +# exclude /etc/pacman.d/offline.conf +function finish { rm -f /run/pacman.conf; } +trap finish EXIT +sed '/^Include *= *\/etc\/pacman\.d\/offline\.conf$/s|^|#|' < /etc/pacman.conf > /run/pacman.conf + # remove triggering symlink rm -f /system-update @@ -14,7 +19,7 @@ rm -f /system-update if [ "$(pacman --sync --print --needed archlinux-keyring | wc -l)" -gt 0 ]; then pacman --sync --noconfirm archlinux-keyring fi -pacman --sync --noconfirm --sysupgrade +pacman --config /run/pacman.conf --sync --noconfirm --sysupgrade # clean up package cache pacman --sync --noconfirm --clean -- cgit v1.2.3-54-g00ecf