diff options
author | Christian Hesse <mail@eworm.de> | 2023-06-25 11:23:51 +0200 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2023-06-25 11:28:49 +0200 |
commit | 7480f12e05220b14e331c7ba8cfaf7be6b6b324d (patch) | |
tree | d2090aa3893e2c56139f2bbcc8f9b2b583195dcc | |
parent | 0069ae768af1d1a89cd2db7ba0f613bb382e10d4 (diff) | |
download | pacman-offline-7480f12e05220b14e331c7ba8cfaf7be6b6b324d.tar.gz pacman-offline-7480f12e05220b14e331c7ba8cfaf7be6b6b324d.tar.zst |
add option to clean cache
-rwxr-xr-x | bin/pacman-offline | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/bin/pacman-offline b/bin/pacman-offline index 1a7c794..1573eb8 100755 --- a/bin/pacman-offline +++ b/bin/pacman-offline @@ -6,17 +6,22 @@ function help() { echo "usage: ${0} [OPTIONS]" echo echo ' -f force if other system-update is pending' + echo ' -c clean before download' echo ' -h this help' echo ' -r reboot and install immediately' echo ' -t start timer for nightly reboot' echo ' -y update sync databases' } +CLEAN=0 REBOOT=0 TIMER=0 -while getopts 'fhrty' opt; do +while getopts 'cfhrty' opt; do case ${opt} in + c) + CLEAN=1 + ;; f) rm -f /system-update ;; @@ -56,6 +61,11 @@ if [ "$(pacman --config /run/pacman.conf --sync --sysupgrade --print | wc -l)" - exit 0 fi +# clean cache +if [ ${CLEAN} -eq 1 ]; then + pacman --sync --noconfirm --clean +fi + # download packages pacman --config /run/pacman.conf --sync --noconfirm --sysupgrade --downloadonly |