summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xchcleanup8
1 files changed, 4 insertions, 4 deletions
diff --git a/chcleanup b/chcleanup
index e732b8c..26c1a27 100755
--- a/chcleanup
+++ b/chcleanup
@@ -9,13 +9,12 @@
set -e
-source $(dirname $0)/libremessages
source /etc/makepkg.conf
+source /etc/libretools.conf
source ${HOME}/.makepkg.conf 2>/dev/null|| true
msg "Cleaning chroot..."
-
TMPDIR="$(mktemp -d /tmp/$(basename $0)-XXXXX)"
cleanup_log="${TMPDIR}"/libretools-cleanup.log
@@ -48,9 +47,10 @@ packages=($(comm -23 <(pacman -Qq | sort) \
msg2 "Removing %d packages" ${#packages[@]}
# Only remove leftovers, -Rcs removes too much
-sudo pacman --noconfirm -Rn ${packages[@]}
+${DRYRUN} || sudo pacman --noconfirm -Rn ${packages[@]}
+${DRYRUN} && echo ${packages[@]}
# Cleanup
-rm -fr ${TMPDIR}
+${DRYRUN} || rm -fr ${TMPDIR}
exit $?