Subject: +BUILD_INFO for Perl modules correct?
To: None <tech-pkg@NetBSD.org>
From: Klaus Heinz <k.heinz.apr.sieben@kh-22.de>
List: tech-pkg
Date: 05/01/2007 00:51:56
--sm4nu43k4a2Rpi4c
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Hi,

is it correct when 

  $ fgrep REQUIRES /var/db/pkg/p5-*/+BUILD_INFO

tells me that 65 of 152 Perl modules (all 65 installed after 2006-08-12)
depend directly on /lib/libc.so.12?

Closer inspection shows that mk/flavor/pkg/metadata.mk considers /bin/rmdir
as used in "@unexec /bin/rmdir..." in the PLIST as a file belonging to the
package and thus lists /lib/libc.so.12 from the ldd output

  $ ldd /bin/rmdir
  /bin/rmdir:
        -lc.12 => /lib/libc.so.12

in a REQUIRES line in +BUILD_INFO, even if the package does not contain
any binary programs (such as pure Perl packages).

If this was not done on purpose, the appended patch would remove this
behaviour.

ciao
     Klaus

--sm4nu43k4a2Rpi4c
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="metadata.mk.diff2"

--- metadata.mk.orig	2007-04-21 17:02:38.000000000 +0200
+++ metadata.mk	2007-05-01 00:49:27.000000000 +0200
@@ -64,10 +64,10 @@
 	"")	ldd=`${TYPE} ldd 2>/dev/null | ${AWK} '{ print $$NF }'` ;; \
 	*)	ldd=${LDD:Q} ;;						\
 	esac;								\
-	bins=`${AWK} '/(^|\/)(bin|sbin|libexec)\// { print "${DESTDIR}${PREFIX}/" $$0 } END { exit 0 }' ${PLIST}`; \
+	bins=`${AWK} '/(^|^[^@].*\/)(bin|sbin|libexec)\// { print "${DESTDIR}${PREFIX}/" $$0 } END { exit 0 }' ${PLIST}`; \
 	case ${OBJECT_FMT:Q}"" in					\
 	ELF)								\
-		libs=`${AWK} '/(^|\/)lib\/lib.*\.so\.[0-9]+$$/ { print "${DESTDIR}${PREFIX}/" $$0 } END { exit 0 }' ${PLIST}`; \
+		libs=`${AWK} '/(^|^[^@].*\/)lib\/lib.*\.so\.[0-9]+$$/ { print "${DESTDIR}${PREFIX}/" $$0 } END { exit 0 }' ${PLIST}`; \
 		if ${TEST} -n "$$bins" -o -n "$$libs"; then		\
 			requires=`($$ldd $$bins $$libs 2>/dev/null || ${TRUE}) | ${AWK} '$$2 == "=>" && $$3 ~ "/" { print $$3 }' | ${SORT} -u`; \
 		fi;							\

--sm4nu43k4a2Rpi4c--