1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-12-21 15:28:50 -05:00

makepkg: print files with refs to $srcdir/$pkgdir

Since rewriting build_references() anyway, tweaked quoting.
Implements FS#31558.

Signed-off-by: Ivy Foster <ivy.foster@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
Ivy Foster 2016-10-15 18:34:49 -05:00 committed by Allan McRae
parent 4c4ce473d6
commit e8c35bea2b

View File

@ -25,14 +25,16 @@ LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
source "$LIBRARY/util/message.sh"
lint_package_functions+=('warn_build_references')
warn_build_references() {
if find "${pkgdir}" -type f -print0 | xargs -0 grep -q -I "${srcdir}" ; then
warning "$(gettext "Package contains reference to %s")" "\$srcdir"
fi
if find "${pkgdir}" -type f -print0 | xargs -0 grep -q -I "${pkgdirbase}" ; then
warning "$(gettext "Package contains reference to %s")" "\$pkgdir"
fi
local refs
for var in srcdir pkgdir; do
mapfile -t refs < <(find "$pkgdir" -type f -exec grep -l "${!var}" {} +)
if (( ${#refs} > 0 )); then
warning "$(gettext 'Package contains reference to %s')" "\$$var"
printf '%s\n' "${refs[@]}" >&2
fi
done
}