Subject: xmlcatmgr as build dependency breaks packages
To: None <>
From: Julio M. Merino Vidal <>
List: tech-pkg
Date: 04/26/2004 17:16:30
Hi all,

just try to run make under devel/buildtool-doc (no need to download nor
install any dependencies) and you'll get:

[dawn buildtool-doc] $ make
make: "../../mk/buildlink3/../../mk/buildlink3/" line 243: Malformed conditional (empty(${_BLNK_RECMETHOD.xmlcatmgr}:M${_depend_}\:*))
make: "../../mk/buildlink3/../../mk/buildlink3/" line 243: Missing dependency operator
make: "../../mk/../../mk/" line 1391: if-less endif
make: "../../mk/../../mk/" line 1391: Need an operator
make: Fatal errors encountered -- cannot continue

make: stopped in /home/jmmv/NetBSD/pkgsrc/devel/buildtool-doc

This is caused because this package sets xmlcatmgr as a build dependency only
by doing: BUILDLINK_DEPMETHOD.xmlcatmgr=build.

The problem is that contains the following chunk of code:

.  if !empty(BUILDLINK_DEPMETHOD.${_pkg_}:Mfull)
.  elif !empty(BUILDLINK_DEPMETHOD.${_pkg_}:Mbuild)
.  endif

As you can see, _BLNK_RECMETHOD.${_pkg_} is not defined in the second part of
the conditional, so the conditional in line 243 fails later.  (I tried to
define the variable to the empty string, but no luck).

I'm not sure about the following patch... it adds another check, and avoids
doing that check in case we are using a full dependency; is it ok?
Maybe I should just check if the variable is defined in line 243 before
checking its value?


RCS file: /cvsroot/pkgsrc/mk/buildlink3/,v
retrieving revision 1.141
diff -u -r1.141
---	24 Apr 2004 15:49:42 -0000	1.141
+++	26 Apr 2004 15:12:29 -0000
@@ -238,7 +238,8 @@
 .    endfor
 .  endif
 .  if defined(BUILDLINK_RECOMMENDED.${_pkg_}) && \
-      defined(BUILDLINK_PKGSRCDIR.${_pkg_})
+      defined(BUILDLINK_PKGSRCDIR.${_pkg_}) && \
+      !empty(BUILDLINK_DEPMETHOD.${_pkg_}:Mfull)
 .    for _rec_ in ${BUILDLINK_RECOMMENDED.${_pkg_}}
 .      if empty(${_BLNK_RECMETHOD.${_pkg_}}:M${_depend_}\:*)
 ${_BLNK_RECMETHOD.${_pkg_}}+=	${_rec_}:${BUILDLINK_PKGSRCDIR.${_pkg_}}

Julio M. Merino Vidal <>
The NetBSD Project -