aboutsummaryrefslogtreecommitdiffstats
path: root/systemd
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2020-01-28 11:16:55 +0100
committerGravatar Christian Hesse <mail@eworm.de>2020-01-28 11:33:01 +0100
commit65c8e0638b90d619ea8450f37af832af9b657fd1 (patch)
tree5e55944034fa0aca3d89fab12076820a09e616e4 /systemd
parent54bed85724efa95898610fed877d2eedbe7c23c7 (diff)
downloadpacman-offline-65c8e0638b90d619ea8450f37af832af9b657fd1.tar.gz
pacman-offline-65c8e0638b90d619ea8450f37af832af9b657fd1.tar.zst
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.
Diffstat (limited to 'systemd')
-rwxr-xr-xsystemd/pacman-offline7
1 files changed, 6 insertions, 1 deletions
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