diff options
Diffstat (limited to 'librechroot')
-rwxr-xr-x | librechroot | 34 |
1 files changed, 2 insertions, 32 deletions
diff --git a/librechroot b/librechroot index 9e292f5..b4766e6 100755 --- a/librechroot +++ b/librechroot @@ -44,39 +44,9 @@ function usage { } function clean_chroot { # Clean packages with pacman - msg "Cleaning chroot: ${CHROOTDIR}/${CHROOTNAME}" - cp "/etc/libretools.d/cleansystem" "${CHROOTDIR}/${CHROOTNAME}/cleansystem" - (cat <<EOF -#!/bin/bash -export LANG=C - -count='0' - -while [ "\$count" -lt "3" ]; do - - pkgs=(\$(comm -23 <(pacman -Qq | sort) <(sort /cleansystem))) - - if [ \${#pkgs[@]} -gt 0 ]; then - pacman --noconfirm -Rcs \${pkgs[@]} - else - echo "clean" - exit 0 - fi - - declare -i "count=\$count + 1" - -done - -echo "Cleaning failed: please report error" - -EOF - ) > "${CHROOTDIR}/${CHROOTNAME}/clean" - - chmod +x "${CHROOTDIR}/${CHROOTNAME}/clean" - mkarchroot -r "/clean" "${CHROOTDIR}/${CHROOTNAME}" + cp -a "$(dirname $0)/chcleanup" "${CHROOTDIR}/${CHROOTNAME}/clean" - rm "${CHROOTDIR}/${CHROOTNAME}/clean" - rm "${CHROOTDIR}/${CHROOTNAME}/cleansystem" + mkarchroot -r "/clean" } function clean_repo { |