diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/chroot-tools/chcleanup.in | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/chroot-tools/chcleanup.in b/src/chroot-tools/chcleanup.in index 411fc4b..06f3eda 100644 --- a/src/chroot-tools/chcleanup.in +++ b/src/chroot-tools/chcleanup.in @@ -1,6 +1,6 @@ #!/usr/bin/env bash # Copyright (C) 2011-2012 Nicolás Reynolds <fauno@parabola.nu> -# Copyright (C) 2012-2013, 2015, 2017 Luke Shumaker <lukeshu@parabola.nu> +# Copyright (C) 2012-2013, 2015, 2017-2018 Luke Shumaker <lukeshu@parabola.nu> # # If you don't see m4_include(...) below, but see function definitions # for msg() et al., then this is a generated file, and contains some @@ -54,13 +54,13 @@ fi # intentionally hard-coded. source /etc/libretools.d/chroot.conf # If we're running makepkg -if [[ -f PKGBUILD ]]; then +if [[ -f ./PKGBUILD ]]; then + if [[ ! -f ./.SRCINFO || ./PKGBUILD -nt ./.SRCINFO ]]; then + sudo -u "#$(stat -c %u -- ./PKGBUILD)" sh -c 'makepkg --printsrcinfo > .SRCINFO' + fi CARCH="$(. /etc/makepkg.conf; printf '%s' "$CARCH")" - export CARCH - source ./PKGBUILD - CHROOTEXTRAPKG+=("${depends[@]}" - "${makedepends[@]}" - "${checkdepends[@]}") + mapfile -t all_depends < <(sed -nE "s/^\\s+(|make|check)depends(|_${CARCH}) = //p" < .SRCINFO) + CHROOTEXTRAPKG+=("${all_depends[@]}") fi msg "Cleaning chroot..." |