summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorrillig <rillig@pkgsrc.org>2020-06-06 09:33:56 +0000
committerrillig <rillig@pkgsrc.org>2020-06-06 09:33:56 +0000
commitbdd59ef41db3d91976f1e6688ae56666d46b1b50 (patch)
treee47cd8c2c4db11dff882f922d831588a729cf4c7 /mk
parente9ee3e1b1bd1ca8670178c03716a233d19115f3b (diff)
downloadpkgsrc-bdd59ef41db3d91976f1e6688ae56666d46b1b50.tar.gz
mk/.../metadata.mk: fix reference to undefined shell variable
When RUN includes the -u shell option (see the pkgsrc guide, section bulk.var.shvar), there is a stray "requires: parameter not set" error. This error doesn't make the build fail immediately since it is on the left-hand side of a pipe, where the exit status is ignored. It would fail if the shell for bmake were set to bash and its option "pipefail" were enabled.
Diffstat (limited to 'mk')
-rw-r--r--mk/pkgformat/pkg/metadata.mk9
1 files changed, 5 insertions, 4 deletions
diff --git a/mk/pkgformat/pkg/metadata.mk b/mk/pkgformat/pkg/metadata.mk
index 9a64cd25b90..7fd44bd3609 100644
--- a/mk/pkgformat/pkg/metadata.mk
+++ b/mk/pkgformat/pkg/metadata.mk
@@ -1,4 +1,4 @@
-# $NetBSD: metadata.mk,v 1.26 2020/05/22 01:24:05 joerg Exp $
+# $NetBSD: metadata.mk,v 1.27 2020/06/06 09:33:56 rillig Exp $
######################################################################
### The targets below are all PRIVATE.
@@ -62,6 +62,7 @@ ${_BUILD_INFO_FILE}: ${_PLIST_NOKEYWORDS}
*) ldd=${LDD:Q} ;; \
esac; \
bins=`${AWK} '/(^|\/)(bin|sbin|libexec)\// { print "${DESTDIR}${PREFIX}/" $$0 } END { exit 0 }' ${_PLIST_NOKEYWORDS}`; \
+ requires=""; \
case ${OBJECT_FMT:Q}"" in \
ELF) \
libs=`${AWK} '/\/lib.*\.so(\.[0-9]+)*$$/ { print "${DESTDIR}${PREFIX}/" $$0 } END { exit 0 }' ${_PLIST_NOKEYWORDS}`; \
@@ -105,12 +106,12 @@ ${_BUILD_INFO_FILE}: ${_PLIST_NOKEYWORDS}
requires=`{ for i in $$requires $$requires; do echo $$i; done; \
${AWK} '{ print "${PREFIX}/" $$0 }' ${_PLIST_NOKEYWORDS}; } | \
${SORT} | uniq -c | awk '$$1 == 2 {print $$2}'`; \
- for i in "" $$libs; do \
+ for i in $$libs; do \
${TEST} "$$i" != "" || continue; \
- ${ECHO} "PROVIDES=$${i}"; \
+ ${ECHO} "PROVIDES=$$i"; \
done | ${SED} -e 's,^PROVIDES=${DESTDIR},PROVIDES=,' \
>> ${.TARGET}.tmp; \
- for req in "" $$requires; do \
+ for req in $$requires; do \
${TEST} "$$req" != "" || continue; \
${ECHO} "REQUIRES=$$req" >> ${.TARGET}.tmp; \
done