diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2018-08-02 23:45:33 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2018-08-03 03:34:58 -0400 |
commit | 391aa4e6621986518ac3597f23af2b8916dd891a (patch) | |
tree | 5bf3dc14ff305fe3e4ec8ebc047927a0f3e5f449 | |
parent | 74c6b30d7dcacb59d94a023f04ba45f19643a8f4 (diff) |
chcleanup: Consider _$CARCH deps
Also, don't parse PKGBUILD ourself; use .SRCINFO to extract
information from the PKGBUILD.
-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..." |