diff options
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/pacman-offline | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/bin/pacman-offline b/bin/pacman-offline index 534a0a9..0105f54 100755 --- a/bin/pacman-offline +++ b/bin/pacman-offline @@ -37,17 +37,22 @@ if [ -e '/system-update' -a "$(readlink '/system-update')" != '/var/cache/pacman exit 1 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 the symlink for now, will be recreated it later rm -f /system-update # check for available updates -if [ "$(pacman --sync --sysupgrade --print | wc -l)" -eq 0 ]; then +if [ "$(pacman --config /run/pacman.conf --sync --sysupgrade --print | wc -l)" -eq 0 ]; then echo "No updates available." exit 0 fi # download packages -pacman --sync --noconfirm --sysupgrade --downloadonly +pacman --config /run/pacman.conf --sync --noconfirm --sysupgrade --downloadonly # enable system update ln -sf /var/cache/pacman/pkg /system-update |