diff options
author | Nicolás Reynolds <fauno@kiwwwi.com.ar> | 2012-10-17 22:39:27 -0300 |
---|---|---|
committer | Nicolás Reynolds <fauno@kiwwwi.com.ar> | 2012-10-17 22:39:27 -0300 |
commit | eda9bd59c2d8919f90aa72cf6cffd545d7bd2295 (patch) | |
tree | 554120ad087a678423ce2148c2a6126551a05bd5 /chcleanup | |
parent | 6c95ce9aedf6b1e9353e48f1e52e9989a563980b (diff) |
Don't fail if depends are empty
Diffstat (limited to 'chcleanup')
-rwxr-xr-x | chcleanup | 19 |
1 files changed, 12 insertions, 7 deletions
@@ -25,14 +25,19 @@ touch ${cleanup_log} if [ -f PKGBUILD ]; then source PKGBUILD || true + check=(${depends[@]} ${makedepends[@]} ${checkdepends[@]}) + + if [ ${#check[@]} -ne 0 ]; then + # Update the cleansystem database - sudo pacman -b "${BD:-/var/lib/libretools/clean}" -Sy + sudo pacman -b "${BD:-/var/lib/libretools/clean}" -Sy # Get the full list of packages needed by dependencies - sudo pacman -b "${BD:-/var/lib/libretools/clean}" \ - -Sp \ - --print-format "%n" \ - ${depends[@]} ${makedepends[@]} ${checkdepends[@]} \ - >${cleanup_log} + sudo pacman -b "${BD:-/var/lib/libretools/clean}" \ + -Sp \ + --print-format "%n" \ + ${check[@]} \ + >${cleanup_log} + fi fi # Diff installed packages against a clean chroot and needed packages, @@ -43,7 +48,7 @@ packages=($(comm -23 <(pacman -Qq | sort) \ [ ${#packages[@]} -eq 0 ] && exit 0 -msg2 "Removing ${#packages[@]} packages: ${packages[@]}" +msg2 "Removing %d packages: %s" ${#packages[@]} "${packages[@]}" # Only remove leftovers, -Rcs removes too much sudo pacman --noconfirm -Rn ${packages[@]} |