From 61ca876072f8e7a5a6ab90974db895c57434ae9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Reynolds?= Date: Mon, 5 Nov 2012 16:13:14 -0300 Subject: Added DRYRUN mode and use libretools.conf --- chcleanup | 8 ++++---- 1 file 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 $? -- cgit v1.2.3