summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2023-06-25 11:23:51 +0200
committerGravatar Christian Hesse <mail@eworm.de>2023-06-25 11:28:49 +0200
commit7480f12e05220b14e331c7ba8cfaf7be6b6b324d (patch)
treed2090aa3893e2c56139f2bbcc8f9b2b583195dcc /bin
parent0069ae768af1d1a89cd2db7ba0f613bb382e10d4 (diff)
downloadpacman-offline-7480f12e05220b14e331c7ba8cfaf7be6b6b324d.tar.gz
pacman-offline-7480f12e05220b14e331c7ba8cfaf7be6b6b324d.tar.zst
add option to clean cache
Diffstat (limited to 'bin')
-rwxr-xr-xbin/pacman-offline12
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