1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-08-13 17:03:46 -04:00

makepkg: Fix the check for references to srcdir/pkgdir

At least in FreeBSD, find always returns 0 if it finds stuff
(imagine that). It doesn't care about the exit status of whatever is
passed to -exec.

This patch makes the checks compatible with this behaviour.

Using xargs and not using grep directly because packages with too many
files would cause grep to complain about argument list being too long.

This should also fix the false positive in packages with no files.

Signed-off-by: Nezmer <git@nezmer.info>
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
Nezmer 2011-02-01 12:02:50 -05:00 committed by Dan McGee
parent 3444146b48
commit 332dd86912

View File

@ -1000,10 +1000,10 @@ check_package() {
done
# check for references to the build and package directory
if find "${pkgdir}" -type f -exec grep -q -I "${srcdir}" {} +; then
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 -exec grep -q -I "${pkgdir}" {} +; then
if find "${pkgdir}" -type f -print0 | xargs -0 grep -q -I "${pkgdir}" ; then
warning "$(gettext "Package contains reference to %s")" "\$pkgdir"
fi