Subject: pkg/25088: recursive pkg dependencies are back, for the wrong reasons
To: None <gnats-bugs@gnats.netbsd.org>
From: None <tv@duh.org>
List: pkgsrc-bugs
Date: 04/07/2004 10:06:27
>Number:         25088
>Category:       pkg
>Synopsis:       recursive pkg dependencies are back, for the wrong reasons
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Apr 07 14:08:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator:     Todd Vierling
>Release:        pkgsrc 20040407
>Organization:
	DUH.ORG:  Pointing out the obvious since 1994.
>Environment:
>Description:

From mails sent outside of public lists, which I consider now descriptive
enough to encapsulate in this PR:

=========================
Date: Tue, 6 Apr 2004 19:20:20 -0400 (EDT)
From: Todd Vierling <tv@duh.org>
Subject: Re: Please remove that recursive dependency stuff from
    buildlink[23]...

On Wed, 7 Apr 2004, <elided> wrote:

: > Short take:  If you want GNOME apps to build with db4, you need to set the
: > variable when building the application, not just gnome-libs.
:
: I mainly agree with you.  However, the fact remains that you want
: to build different packages with different variants of certain
: prerequisites (e.g. BDB versions).  Obviously, you can't compile gnome
: apps with DBD 1.85 headers and expect them to work when linked against BDB
: 4.x libraries.  So some scheme has to be worked out to somehow propagate
: the correct prerequisites up the dependency tree.

I see this as a bug in the gnome-libs package.  If GNOME apps must link with
a consistent version of a dependency, then gnome-libs should have its own,
separate BDB version selection variable that does not affect the rest of
pkgsrc.

There are three major classes of dependency (sigh, this has to be the
(N+1)th time I've described this in excruciating detail):

1. Direct dependency.  This is where an application #includes the headers
   of, and links to the libraries of, the dependency.  In pkgsrc, this
   should be expressed as a *direct* buildlink or DEPENDS on that direct
   dependency.

2. Abstracted API.  This is where an API completely hides the underlying
   layer upon which that API builds.  Easy examples are things like SDL, or
   perhaps Xrender underlying GTK2 (haven't verified this yet).  Such
   dependencies should be expressed as only a buildlink or DEPENDS on the
   abstracted API, and the dependency on the underlying library should only
   exist in the abstracted API's Makefile.

3. API exposing a direct dependency.  This is where one API builds upon
   another, such as GTK2 exposing GLIB2's structures via #include.  This
   is the only case which should be expressed as a recursively inclusive
   dependency, as both APIs are directly available to the application.

There are quite a few packages actually in case 1 which are using recursive
dependencies as per case 3 (SDL, for instance, which I plan on fixing soon);
and some packages which should instead be implemented as case 2, placing the
indirect dependency only in the intermediate library's Makefile.

Likewise, I believe that the cited case of gnome-libs is currently
implemented as case 3, but should instead be using case 1 or case 2.  Code
inspection would be required to see which one is the correct approach.  If,
indeed, it falls under case 3, then there should be a separate
GNOME-specific BDB version selection variable -- thus not foisting a
recursion sledgehammer onto the rest of pkgsrc.

The changes currently in buildlink[23] break established pkgsrc usage,
revert us to unnecessary recursion, and increase build time significantly on
slow platforms.  I would like to see them reverted and the problem properly
reevaluated for what it is:  problems in the way dependencies are currently
being expressed.

-- 
-- Todd Vierling <tv@duh.org> <tv@pobox.com>

=========================
From: Todd Vierling <tv@duh.org>
Subject: Re: Please remove that recursive dependency stuff from
    buildlink[23]...

On Tue, 6 Apr 2004, Todd Vierling wrote:

: There are quite a few packages actually in case 1 which are using recursive
: dependencies as per case 3 (SDL, for instance, which I plan on fixing soon);
: and some packages which should instead be implemented as case 2, placing the
: indirect dependency only in the intermediate library's Makefile.

Feh.  SDL is actually case 2, not case 1.  I was thinking of meta-packages
in case 1.

-- 
-- Todd Vierling <tv@duh.org> <tv@pobox.com>

========== END ==========

>How-To-Repeat:

Compile any package with buildlink2 dependencies and a configurable extension.
Now compile some app dependent on that package, but with a different chosen
extension option.  See that the dependencies for the app are not what you asked
for when compiling the app.  (Searching for a real-world example.  However, the
majority of this case comes from the intended work to *unwrap* much of the
improperly recursive buildlink[23]s in several places.  That work is now
utterly moot, as the unwrapping will do no good--this recursion will just
forcibly bring the removed, indirect buildlink[23]s back.)

To demonstrate the reintroduction of the recursion quite visibly, set
PKG_JVM_DEFAULT=kaffe, install lang/kaffe, then compile textproc/crimson.
The crimson build should depend ONLY on kaffe, but indeed now directly
depends on everything kaffe had in its DEPENDS.

>Fix:

Revert rev 1.121 of pkgsrc/mk/buildlink2/bsd.buildlink2.mk, and
revs 1.135 and 1.132 of pkgsrc/mk/buildlink3/bsd.buildlink3.mk.  There is
a slight whitespace conflict, so the following patch can be used instead.

==========================

Index: mk/buildlink2/bsd.buildlink2.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/buildlink2/bsd.buildlink2.mk,v
retrieving revision 1.123
diff -u -r1.123 bsd.buildlink2.mk
--- mk/buildlink2/bsd.buildlink2.mk	30 Mar 2004 21:58:45 -0000	1.123
+++ mk/buildlink2/bsd.buildlink2.mk	7 Apr 2004 14:05:00 -0000
@@ -133,108 +133,6 @@
 #
 PREPEND_PATH+=	${BUILDLINK_DIR}/bin
 
-_BLNK_PKGVAR?=		${PKGBASE:S/++$/xx/:S/+$//}
-
-# Try to include buildlink2.mk files for any dependencies that are already
-# installed on the system.  This tries to handle the situation where the
-# installed package and the package as it exists in pkgsrc have differing
-# lists of dependencies.  If the package directory has moved or been
-# removed from pkgsrc, then set BUILDLINK_INSTALLED_PKGSRCDIR.<pkg> to the
-# correct PKGPATH for that package or to the empty value if it has been
-# removed.
-#
-.if !defined(_BLNK_INSTALLED_DEPDIRS.${_BLNK_PKGVAR})
-_BLNK_INSTALLED_DEPS=	# empty
-.  for _pkg_ in ${BUILDLINK_PACKAGES}
-BUILDLINK_DEPMETHOD.${_pkg_}?=	full
-.    if !empty(BUILDLINK_DEPMETHOD.${_pkg_}:Mfull)
-BUILDLINK_PKGBASE.${_pkg_}?=	${_pkg_}
-_BLNK_INSTALLED_DEPS.${_pkg_}!=						\
-	pkg="${BUILDLINK_PKGBASE.${_pkg_}}-[0-9]*";			\
-	found=`${PKG_BEST_EXISTS} "$$pkg"`;				\
-	pkgdep=;							\
-	if [ -n "$$found" ]; then					\
-		pkgdep=`${PKG_INFO} -qf "$$found" | ${SED} -n "s/^@pkgdep[ 	]*//p"`; \
-	fi;								\
-	${ECHO} "$$pkgdep"
-_BLNK_INSTALLED_DEPS+=	${_BLNK_INSTALLED_DEPS.${_pkg_}}
-.    endif
-.  endfor
-_BLNK_INSTALLED_DEPPKGS=	# empty
-.  for _dep_ in ${_BLNK_INSTALLED_DEPS}
-_BLNK_TMP_PKGNAME!=	found=`${PKG_BEST_EXISTS} "${_dep_}"`; ${ECHO} "$$found"
-_BLNK_TMP_PKGVAR:=	${_BLNK_TMP_PKGNAME:C/-[^-]*$//}
-#
-# Map package names into buildlink package variable equivalents when it
-# differs from the PKGBASE for that package.
-#
-_BLNK_TMP_PKGVAR:=	${_BLNK_TMP_PKGVAR:S/++$/xx/:S/+$//}
-_BLNK_TMP_PKGVAR:=	${_BLNK_TMP_PKGVAR:S/--$/mm/}
-_BLNK_TMP_PKGVAR:=	${_BLNK_TMP_PKGVAR:S/^PAM$/pam/}
-_BLNK_TMP_PKGVAR:=	${_BLNK_TMP_PKGVAR:S/^freetype-lib$/freetype/}
-_BLNK_TMP_PKGVAR:=	${_BLNK_TMP_PKGVAR:S/^gettext-lib$/gettext/}
-_BLNK_TMP_PKGVAR:=	${_BLNK_TMP_PKGVAR:S/^libaudiofile$/audiofile/}
-_BLNK_TMP_PKGVAR:=	${_BLNK_TMP_PKGVAR:S/^libgetopt$/getopt/}
-_BLNK_TMP_PKGVAR:=	${_BLNK_TMP_PKGVAR:S/^libiconv$/iconv/}
-_BLNK_TMP_PKGVAR:=	${_BLNK_TMP_PKGVAR:S/^libtool-base$/libtool/}
-_BLNK_TMP_PKGVAR:=	${_BLNK_TMP_PKGVAR:C/^py[0-9][0-9][^-]*-/py-/}
-_BLNK_INSTALLED_PKGNAME.${_BLNK_TMP_PKGVAR}:=	${_BLNK_TMP_PKGNAME}
-_BLNK_INSTALLED_DEPPKGS:=						\
-	${_BLNK_INSTALLED_DEPPKGS:N${_BLNK_TMP_PKGVAR}}			\
-	${_BLNK_TMP_PKGVAR}
-.    undef _BLNK_TMP
-.    undef _BLNK_TMP_PKGVAR
-.    undef _BLNK_TMP_PKGNAME
-.  endfor
-_BLNK_INSTALLED_DEPDIRS.${_BLNK_PKGVAR}=	# empty
-.  for _pkg_ in ${_BLNK_INSTALLED_DEPPKGS}
-#
-# If BUILDLINK_PKGSRCDIR.<pkg> is already defined (by a previous inclusion
-# of <pkg>'s buildlink2.mk file), then make that the default value for
-# BUILDLINK_INSTALLED_PKGSRCDIR.<pkg>.  Otherwise, try to dig it out of
-# the +BUILD_INFO file of the installed package.
-#
-.    if defined(BUILDLINK_PKGSRCDIR.${_pkg_})
-BUILDLINK_INSTALLED_PKGSRCDIR.${_pkg_}?=	${BUILDLINK_PKGSRCDIR.${_pkg_}}
-.    endif
-.    if !defined(BUILDLINK_INSTALLED_PKGSRCDIR.${_pkg_})
-BUILDLINK_INSTALLED_PKGSRCDIR.${_pkg_}!=				\
-	dir=`${PKG_INFO} -qB "${_BLNK_INSTALLED_PKGNAME.${_pkg_}}" | ${SED} -n "s/^PKGPATH=//p"`; ${ECHO} "../../$$dir"
-.    endif
-.    if exists(${BUILDLINK_INSTALLED_PKGSRCDIR.${_pkg_}}/buildlink2.mk)
-_BLNK_INSTALLED_DEPDIRS.${_BLNK_PKGVAR}+=				\
-	${BUILDLINK_INSTALLED_PKGSRCDIR.${_pkg_}}
-.    endif
-.  endfor
-.endif
-.for _dir_ in ${_BLNK_INSTALLED_DEPDIRS.${_BLNK_PKGVAR}}
-.  include "${_dir_}/buildlink2.mk"
-.endfor
-
-# Run through EVAL_PREFIX again in case we included any buildlink2.mk files
-# above and need to set BUILDLINK_PREFIX.<pkg> appropriately.
-#
-.if defined(EVAL_PREFIX)
-.  for def in ${EVAL_PREFIX}
-.    if !defined(${def:C/=.*//}_DEFAULT)
-${def:C/=.*//}_DEFAULT=	${X11PREFIX}
-.    endif
-.    if !defined(${def:C/=.*//})
-_depend_${def:C/=.*//}!=						\
-	${PKG_INFO} -e ${def:C/.*=//} 2>/dev/null; ${ECHO}
-.      if empty(_depend_${def:C/=.*//})
-${def:C/=.*//}=	${${def:C/=.*//}_DEFAULT}
-.      else
-_dir_${def:C/=.*//}!=							\
-	(${PKG_INFO} -qp ${def:C/.*=//} 2>/dev/null) |			\
-	${AWK} '{ print $$2; exit }'
-${def:C/=.*//}=	${_dir_${def:C/=.*//}}
-MAKEFLAGS+=	${def:C/=.*//}=${_dir_${def:C/=.*//}}
-.      endif
-.    endif
-.  endfor
-.endif
-
 .for _pkg_ in ${BUILDLINK_PACKAGES}
 #
 # Add the proper dependency on each package pulled in by buildlink2.mk
@@ -243,7 +141,9 @@
 # on <pkg>, otherwise we use a build dependency on <pkg>.  By default,
 # we use a full dependency.
 #
-BUILDLINK_DEPMETHOD.${_pkg_}?=	full
+.  if !defined(BUILDLINK_DEPMETHOD.${_pkg_})
+BUILDLINK_DEPMETHOD.${_pkg_}=	full
+.  endif
 .  if !empty(BUILDLINK_DEPMETHOD.${_pkg_}:Mfull)
 _BUILDLINK_DEPMETHOD.${_pkg_}=	DEPENDS
 _BUILDLINK_RECMETHOD.${_pkg_}=	RECOMMENDED
@@ -270,8 +170,8 @@
 # a list of all of the files installed by <pkg>.  This list is relative to
 # ${BUILDLINK_PREFIX.<pkg>}.
 #
-BUILDLINK_PLIST_CMD.${_pkg_}= 						\
-	${PKG_INFO} -f "${BUILDLINK_PKGBASE.${_pkg_}}-[0-9]*" |		\
+BUILDLINK_PLIST_CMD.${_pkg_}= \
+	${PKG_INFO} -f ${BUILDLINK_PKGBASE.${_pkg_}} |			\
 		${SED} -n '/File:/s/^[ 	]*File:[ 	]*//p'
 .endfor
 
@@ -368,9 +268,8 @@
 			;;						\
 		esac;							\
 		pkg_prefix=;						\
-		if [ -n "${BUILDLINK_PKGBASE.${.TARGET:S/-buildlink//}}" ] && \
-		   ${PKG_INFO} -qe "${BUILDLINK_PKGBASE.${.TARGET:S/-buildlink//}}-[0-9]*"; then \
-			pkg_prefix=`${PKG_INFO} -qp "${BUILDLINK_PKGBASE.${.TARGET:S/-buildlink//}}-[0-9]*" | ${AWK} '{ sub("${BUILDLINK_PREFIX.${.TARGET:S/-buildlink//}}", "", $$2); sub("/", "", $$2); print $$2; exit }'`/; \
+		if [ -n "${BUILDLINK_PKGBASE.${.TARGET:S/-buildlink//}}" ]; then \
+			pkg_prefix=`${PKG_INFO} -qp ${BUILDLINK_PKGBASE.${.TARGET:S/-buildlink//}} | ${AWK} '{ sub("${BUILDLINK_PREFIX.${.TARGET:S/-buildlink//}}", "", $$2); sub("/", "", $$2); print $$2; exit }'`/; \
 		fi;							\
 		rel_files_cmd=;						\
 		if [ -n "${BUILDLINK_FILES_CMD.${.TARGET:S/-buildlink//}:Q}" ]; then \
Index: mk/buildlink3/bsd.buildlink3.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/buildlink3/bsd.buildlink3.mk,v
retrieving revision 1.138
diff -u -r1.138 bsd.buildlink3.mk
--- mk/buildlink3/bsd.buildlink3.mk	6 Apr 2004 04:39:00 -0000	1.138
+++ mk/buildlink3/bsd.buildlink3.mk	7 Apr 2004 14:05:00 -0000
@@ -72,109 +72,6 @@
 # For each package we use, check whether we are using the built-in
 # version of the package or if we are using the pkgsrc version.
 #
-.for _pkg_ in ${BUILDLINK_PACKAGES}
-CHECK_BUILTIN.${_pkg_}=	yes
-.endfor
-.include "../../mk/buildlink3/bsd.builtin.mk"
-
-_BLNK_PKGVAR?=		${PKGBASE:S/++$/xx/:S/+$//}
-
-# Try to include buildlink3.mk files for any dependencies that are already
-# installed on the system.  This tries to handle the situation where the
-# installed package and the package as it exists in pkgsrc have differing
-# lists of dependencies.  If the package directory has moved or been
-# removed from pkgsrc, then set BUILDLINK_INSTALLED_PKGSRCDIR.<pkg> to the
-# correct PKGPATH for that package or to the empty value if it has been
-# removed.
-#
-.if !defined(_BLNK_INSTALLED_DEPDIRS.${_BLNK_PKGVAR})
-_BLNK_INSTALLED_DEPS=	# empty
-.  for _pkg_ in ${BUILDLINK_PACKAGES}
-BUILDLINK_DEPMETHOD.${_pkg_}?=	full
-.    if !empty(BUILDLINK_DEPMETHOD.${_pkg_}:Mfull) && \
-        !empty(USE_BUILTIN.${_pkg_}:M[nN][oO])
-BUILDLINK_PKGBASE.${_pkg_}?=	${_pkg_}
-#
-# XXX This should really recursively walk through the dependency list.
-# XXX This check here for "${BUILDLINK_PKGBASE.<pkg>}-[0-9]*" is also
-# XXX not pkgviews-friendly; it should really be using
-# XXX BUILDLINK_DEPENDS.<pkg> in some way.
-#
-_BLNK_INSTALLED_DEPS.${_pkg_}!=						\
-	pkg="${BUILDLINK_PKGBASE.${_pkg_}}-[0-9]*";			\
-	found=`${PKG_BEST_EXISTS} "$$pkg"`;				\
-	pkgdep=;							\
-	if [ -n "$$found" ]; then					\
-		pkgdep=`${PKG_INFO} -qf "$$found" | ${SED} -n "s/^@pkgdep[ 	]*//p"`; \
-	fi;								\
-	${ECHO} "$$pkgdep"
-_BLNK_INSTALLED_DEPS+=	${_BLNK_INSTALLED_DEPS.${_pkg_}}
-.    endif
-.  endfor
-_BLNK_INSTALLED_DEPPKGS=	# empty
-.  for _dep_ in ${_BLNK_INSTALLED_DEPS}
-_BLNK_TMP_PKGNAME!=	found=`${PKG_BEST_EXISTS} "${_dep_}"`; ${ECHO} "$$found"
-_BLNK_TMP_PKGVAR:=	${_BLNK_TMP_PKGNAME:C/-[^-]*$//}
-#
-# Map package names into buildlink package variable equivalents when it
-# differs from the PKGBASE for that package.
-#
-_BLNK_TMP_PKGVAR:=	${_BLNK_TMP_PKGVAR:S/++$/xx/:S/+$//}
-_BLNK_TMP_PKGVAR:=	${_BLNK_TMP_PKGVAR:S/--$/mm/}
-_BLNK_TMP_PKGVAR:=	${_BLNK_TMP_PKGVAR:S/^PAM$/pam/}
-_BLNK_TMP_PKGVAR:=	${_BLNK_TMP_PKGVAR:S/^freetype-lib$/freetype/}
-_BLNK_TMP_PKGVAR:=	${_BLNK_TMP_PKGVAR:S/^gettext-lib$/gettext/}
-_BLNK_TMP_PKGVAR:=	${_BLNK_TMP_PKGVAR:S/^libaudiofile$/audiofile/}
-_BLNK_TMP_PKGVAR:=	${_BLNK_TMP_PKGVAR:S/^libgetopt$/getopt/}
-_BLNK_TMP_PKGVAR:=	${_BLNK_TMP_PKGVAR:S/^libiconv$/iconv/}
-_BLNK_TMP_PKGVAR:=	${_BLNK_TMP_PKGVAR:S/^libtool-base$/libtool/}
-_BLNK_TMP_PKGVAR:=	${_BLNK_TMP_PKGVAR:C/^py[0-9][0-9][^-]*-/py-/}
-_BLNK_INSTALLED_PKGNAME.${_BLNK_TMP_PKGVAR}:=	${_BLNK_TMP_PKGNAME}
-_BLNK_INSTALLED_DEPPKGS:=						\
-	${_BLNK_INSTALLED_DEPPKGS:N${_BLNK_TMP_PKGVAR}}			\
-	${_BLNK_TMP_PKGVAR}
-.    undef _BLNK_TMP
-.    undef _BLNK_TMP_PKGVAR
-.    undef _BLNK_TMP_PKGNAME
-.  endfor
-_BLNK_INSTALLED_DEPDIRS.${_BLNK_PKGVAR}=	# empty
-.  for _pkg_ in ${_BLNK_INSTALLED_DEPPKGS}
-#
-# We are using the pkgsrc-installed dependency, so clearly we must not be
-# using any built-in version of the same software.
-#
-USE_BUILTIN.${_pkg_}=	no
-#
-# If BUILDLINK_PKGSRCDIR.<pkg> is already defined (by a previous inclusion
-# of <pkg>'s buildlink3.mk file), then make that the default value for
-# BUILDLINK_INSTALLED_PKGSRCDIR.<pkg>.  Otherwise, try to dig it out of
-# the +BUILD_INFO file of the installed package.
-#
-.    if defined(BUILDLINK_PKGSRCDIR.${_pkg_})
-BUILDLINK_INSTALLED_PKGSRCDIR.${_pkg_}?=	${BUILDLINK_PKGSRCDIR.${_pkg_}}
-.    endif
-.    if !defined(BUILDLINK_INSTALLED_PKGSRCDIR.${_pkg_})
-BUILDLINK_INSTALLED_PKGSRCDIR.${_pkg_}!=				\
-	dir=`${PKG_INFO} -qB "${_BLNK_INSTALLED_PKGNAME.${_pkg_}}" | ${SED} -n "s/^PKGPATH=//p"`; ${ECHO} "../../$$dir"
-.    endif
-.    if exists(${BUILDLINK_INSTALLED_PKGSRCDIR.${_pkg_}}/buildlink3.mk)
-_BLNK_INSTALLED_DEPDIRS.${_BLNK_PKGVAR}+=				\
-	${BUILDLINK_INSTALLED_PKGSRCDIR.${_pkg_}}
-.    endif
-.  endfor
-.endif
-.for _dir_ in ${_BLNK_INSTALLED_DEPDIRS.${_BLNK_PKGVAR}}
-BUILDLINK_DEPTH:=	${BUILDLINK_DEPTH}+
-.  include "${_dir_}/buildlink3.mk"
-BUILDLINK_DEPTH:=	${BUILDLINK_DEPTH:S/+$//}
-.endfor
-
-# For each package we use, check whether we are using the built-in
-# version of the package or if we are using the pkgsrc version.
-#
-.for _pkg_ in ${BUILDLINK_PACKAGES}
-CHECK_BUILTIN.${_pkg_}=	no
-.endfor
 .include "../../mk/buildlink3/bsd.builtin.mk"
 
 # Check whether we should include the X11 buildlink3.mk file here since
@@ -200,22 +97,21 @@
 # We can then check for this value to avoid build loops.
 #
 .for _pkg_ in ${BUILDLINK_PACKAGES}
-IGNORE_PKG.${_pkg_}?=	no
 .  if defined(BUILDLINK_PKGSRCDIR.${_pkg_})
-.    if (${BUILDLINK_PKGSRCDIR.${_pkg_}:C|.*/([^/]*/[^/]*)$|\1|} == ${PKGPATH})
+.    if !defined(IGNORE_PKG.${_pkg_}) && \
+        (${BUILDLINK_PKGSRCDIR.${_pkg_}:C|.*/([^/]*/[^/]*)$|\1|} == ${PKGPATH})
 IGNORE_PKG.${_pkg_}=	yes
-BUILDLINK_VARS+=	IGNORE_PKG.${_pkg_}=${IGNORE_PKG.${_pkg_}}
+MAKEFLAGS+=		IGNORE_PKG.${_pkg_}=${IGNORE_PKG.${_pkg_}}
 .    endif
 .  endif
 .endfor
 
 # _BLNK_PACKAGES contains all of the unique elements of BUILDLINK_PACKAGES
-# that shouldn't be ignored.
+# that shouldn't be skipped.
 #
 _BLNK_PACKAGES=		# empty
 .for _pkg_ in ${BUILDLINK_PACKAGES}
-.  if empty(_BLNK_PACKAGES:M${_pkg_}) && \
-      empty(IGNORE_PKG.${_pkg_}:M[yY][eE][sS])
+.  if empty(_BLNK_PACKAGES:M${_pkg_}) && !defined(IGNORE_PKG.${_pkg_})
 _BLNK_PACKAGES+=	${_pkg_}
 .  endif
 .endfor
@@ -239,8 +135,7 @@
 _BLNK_DEPENDS=	# empty
 .for _pkg_ in ${BUILDLINK_DEPENDS}   
 USE_BUILTIN.${_pkg_}?=	no
-.  if empty(_BLNK_DEPENDS:M${_pkg_}) && \
-      empty(IGNORE_PKG.${_pkg_}:M[yY][eE][sS]) && \
+.  if empty(_BLNK_DEPENDS:M${_pkg_}) && !defined(IGNORE_PKG.${_pkg_}) && \
       !empty(_BLNK_PACKAGES:M${_pkg_}) && \
       !empty(USE_BUILTIN.${_pkg_}:M[nN][oO])
 _BLNK_DEPENDS+=	${_pkg_}
@@ -367,7 +262,6 @@
 #				information for <pkg>
 #
 # BUILDLINK_PKGNAME.<pkg>	the name of the package
-# BUILDLINK_PKGBASE.<pkg>	the name of the package without the version
 #
 # BUILDLINK_IS_DEPOT.<pkg>	"yes" or "no" for whether <pkg> is a
 #				depoted package.
>Release-Note:
>Audit-Trail:
>Unformatted: