diff options
author | heinz <heinz@pkgsrc.org> | 2007-05-28 13:54:25 +0000 |
---|---|---|
committer | heinz <heinz@pkgsrc.org> | 2007-05-28 13:54:25 +0000 |
commit | ada9d78f219a72eb5b4f9f4d2a9b917272825c7e (patch) | |
tree | bdaf2bf0af2d1208096d3d067995d414f0ca057b /mk | |
parent | d579fd6cef117ad817e25881599de6bf5ce551dd (diff) | |
download | pkgsrc-ada9d78f219a72eb5b4f9f4d2a9b917272825c7e.tar.gz |
In order to avoid incorrect information about needed shared libraries in
+BUILD_INFO we must ensure that we only test valid lines from PLIST and
not lines like "@unexec /bin/rmdir..." where "/bin/rmdir" is not a part
of the resulting package.
To achieve this, a stripped version of PLIST, called _PLIST_NOKEYWORDS,
is introduced.
Diffstat (limited to 'mk')
-rw-r--r-- | mk/flavor/pkg/metadata.mk | 10 | ||||
-rw-r--r-- | mk/plist/plist.mk | 19 |
2 files changed, 22 insertions, 7 deletions
diff --git a/mk/flavor/pkg/metadata.mk b/mk/flavor/pkg/metadata.mk index 093d9ad5c20..ac7913dfe3c 100644 --- a/mk/flavor/pkg/metadata.mk +++ b/mk/flavor/pkg/metadata.mk @@ -1,4 +1,4 @@ -# $NetBSD: metadata.mk,v 1.21 2007/05/26 11:58:33 heinz Exp $ +# $NetBSD: metadata.mk,v 1.22 2007/05/28 13:54:25 heinz Exp $ ###################################################################### ### The targets below are all PRIVATE. @@ -61,14 +61,14 @@ ${_BUILD_INFO_FILE}: plist "") 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_NOKEYWORDS}`; \ 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_NOKEYWORDS}`; \ if ${TEST} -n "$$bins" -o -n "$$libs"; then \ requires=`($$ldd $$bins $$libs 2>/dev/null || ${TRUE}) | ${AWK} '$$2 == "=>" && $$3 ~ "/" { print $$3 }' | ${SORT} -u`; \ fi; \ - linklibs=`${AWK} '/[^@].*\.so\.[0-9\.]+$$/ { print "${DESTDIR}${PREFIX}/" $$0 }' ${PLIST}`; \ + linklibs=`${AWK} '/.*\.so\.[0-9\.]+$$/ { print "${DESTDIR}${PREFIX}/" $$0 }' ${_PLIST_NOKEYWORDS}`; \ for i in $$linklibs; do \ if ${TEST} -r $$i -a ! -x $$i -a ! -h $$i; then \ ${TEST} ${PKG_DEVELOPER:Uno:Q}"" = "no" || \ @@ -78,7 +78,7 @@ ${_BUILD_INFO_FILE}: plist done; \ ;; \ Mach-O) \ - libs=`${AWK} '/(^|\/)lib\/lib.*\.dylib/ { print "${DESTDIR}${PREFIX}/" $$0 } END { exit 0 }' ${PLIST}`; \ + libs=`${AWK} '/(^|\/)lib\/lib.*\.dylib/ { print "${DESTDIR}${PREFIX}/" $$0 } END { exit 0 }' ${_PLIST_NOKEYWORDS}`; \ if ${TEST} "$$bins" != "" -o "$$libs" != ""; then \ requires=`($$ldd $$bins $$libs 2>/dev/null || ${TRUE}) | ${AWK} '/compatibility version/ { print $$1 }' | ${SORT} -u`; \ fi; \ diff --git a/mk/plist/plist.mk b/mk/plist/plist.mk index 1448cdb8fbd..f51f73da1ec 100644 --- a/mk/plist/plist.mk +++ b/mk/plist/plist.mk @@ -1,4 +1,4 @@ -# $NetBSD: plist.mk,v 1.22 2007/04/19 23:13:42 tnn Exp $ +# $NetBSD: plist.mk,v 1.23 2007/05/28 13:54:25 heinz Exp $ # # This Makefile fragment handles the creation of PLISTs for use by # pkg_create(8). @@ -64,6 +64,7 @@ PLIST_SRC+= ${PKGDIR}/PLIST.common_end # This is the path to the generated PLIST file. PLIST= ${WRKDIR}/.PLIST +_PLIST_NOKEYWORDS=${PLIST}.nokeywords ###################################################################### @@ -229,7 +230,7 @@ _GENERATE_PLIST= ${_SET_OWNER_GROUP}; \ .endif .PHONY: plist -plist: ${PLIST} +plist: ${PLIST} ${_PLIST_NOKEYWORDS} .if ${PLIST_TYPE} == "static" ${PLIST}: ${PLIST_SRC} @@ -242,6 +243,20 @@ ${PLIST}: ${SETENV} ${_PLIST_AWK_ENV} ${AWK} ${_PLIST_SHLIB_AWK} \ > ${.TARGET} +# for list of keywords see pkg_create(1) +${_PLIST_NOKEYWORDS}: ${PLIST} + ${_PKG_SILENT}${_PKG_DEBUG} ${AWK} < ${PLIST} > ${.TARGET} ' \ + BEGIN { \ + FILTER="@("; \ + FILTER=FILTER"cd|cwd|src|exec|unexec|mode|option";\ + FILTER=FILTER"|owner|group|comment|ignore"; \ + FILTER=FILTER"|ignore_inst|name|dirrm|mtree"; \ + FILTER=FILTER"|display|pkgdep|blddep|pkgcfl"; \ + FILTER=FILTER")[[:space:]]"; \ + }; \ + $$0 ~ FILTER { next }; \ + { print }' + .if defined(INFO_FILES) INFO_FILES_cmd= \ ${CAT} ${PLIST} | \ |