diff options
author | Nicolás Reynolds <apoyosis@correo.inta.gob.ar> | 2012-11-05 16:39:27 -0300 |
---|---|---|
committer | Nicolás Reynolds <apoyosis@correo.inta.gob.ar> | 2012-11-05 16:39:27 -0300 |
commit | 070d785ab1f5a72ed52680b18a5120bb2c46c847 (patch) | |
tree | 19336516d152fcac874fa97febee37daeb312575 /librechroot | |
parent | 369245e8dbee7ad97acec087de77081627a255db (diff) | |
parent | 83dd1498e580510023b63611bb25feedd3699b8c (diff) |
Merge branch 'master' of git://ponape.local/libretools
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 { |