aboutsummaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
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