[pacman-dev] [PATCH] makepkg: list files containing $srcdir (FS#31558)

Phillip Smith lists at fukawi2.nl
Mon May 20 02:07:57 EDT 2013


> > Much easier to review if the patch is sent inline....

My apologies, I will do that from now on.


> Close, but there's still word splitting issues here. I'd suggest something like:
>
>   mapfile -t srcdir_refs < \
>     <(cd "$pkgdir" && find -type f -exec grep -Il "$srcdir" {} +))


Thanks for the feedback guys; I've amended as below.



>From 4882226a88927af791979729a1ac47c029b3844d Mon Sep 17 00:00:00 2001
From: Phillip Smith <fukawi2 at gmail.com>
Date: Mon, 20 May 2013 16:06:39 +1000
Subject: [PATCH] makepkg: list files containing $srcdir (FS#31558)

when checking for files in a built package that contain references to
$srcdir or $pkgdir_base, show the files that match to assist in
debugging.
---
 scripts/makepkg.sh.in | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 75ddfe5..1b3cc5a 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -1606,11 +1606,19 @@ tidy_install() {
  done

  # check for references to the build and package directory
- if find "${pkgdir}" -type f -print0 | xargs -0  grep -q -I "${srcdir}" ; then
- warning "$(gettext "Package contains reference to %s")" "\$srcdir"
+ mapfile -t srcdir_refs <<< $(cd "${pkgdir}" && find -type f -exec
grep -I -l "$srcdir" {} \;)
+ if [[ -n ${srcdir_refs[*]} ]] ; then
+ warning "$(gettext "The following files within the package reference
%s")" "\$srcdir"
+ for fname in ${srcdir_refs[*]} ; do
+ printf "  %s\n" "$fname"
+ done
  fi
- if find "${pkgdir}" -type f -print0 | xargs -0  grep -q -I
"${pkgdirbase}" ; then
- warning "$(gettext "Package contains reference to %s")" "\$pkgdir"
+ mapfile -t pkgdir_refs <<< $(cd "${pkgdir}" && find -type f -exec
grep -I -l "${pkgdirbase}" {} \;)
+ if [[ -n ${pkgdir_refs[*]} ]] ; then
+ warning "$(gettext "The following files within the package reference
%s")" "\$pkgdir"
+ for fname in ${pkgdir_refs[*]} ; do
+ printf "  %s\n" "$fname"
+ done
  fi

  if check_option "zipman" "y" && [[ -n ${MAN_DIRS[*]} ]]; then
-- 
1.8.2.3


More information about the pacman-dev mailing list