summaryrefslogtreecommitdiff
path: root/chcleanup
diff options
context:
space:
mode:
authorNicolás Reynolds <fauno@kiwwwi.com.ar>2012-11-05 16:13:14 -0300
committerNicolás Reynolds <fauno@kiwwwi.com.ar>2012-11-05 16:13:14 -0300
commit61ca876072f8e7a5a6ab90974db895c57434ae9c (patch)
tree5c1e719e82d5f298a3bb16ce2fc5d5ba75aac1cc /chcleanup
parent362ec9e880e784ec9bc2858c635b0279e52af82d (diff)
Added DRYRUN mode and use libretools.conf
Diffstat (limited to 'chcleanup')
-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 $?