summaryrefslogtreecommitdiff
path: root/mk/pkg-build-options.mk
diff options
context:
space:
mode:
authorrillig <rillig@pkgsrc.org>2007-05-07 09:26:40 +0000
committerrillig <rillig@pkgsrc.org>2007-05-07 09:26:40 +0000
commit97712cb6ae5fe82d1f44c6a3b0a8a487b5d84eb6 (patch)
treee52e35a7f6127d2619ef291d7468c03bac3ad92e /mk/pkg-build-options.mk
parentc8e911152a008ce255a3565f3fe919efcf014c4a (diff)
downloadpkgsrc-97712cb6ae5fe82d1f44c6a3b0a8a487b5d84eb6.tar.gz
If a package is already installed, the PKG_OPTIONS of the installed
package is returned rather than querying the source package. First, this is more correct, and second, it greatly speeds up pkgsrc, especially when many packages are already installed.
Diffstat (limited to 'mk/pkg-build-options.mk')
-rw-r--r--mk/pkg-build-options.mk12
1 files changed, 6 insertions, 6 deletions
diff --git a/mk/pkg-build-options.mk b/mk/pkg-build-options.mk
index e516b4a39d3..f877ed5ad12 100644
--- a/mk/pkg-build-options.mk
+++ b/mk/pkg-build-options.mk
@@ -1,4 +1,4 @@
-# $NetBSD: pkg-build-options.mk,v 1.2 2007/04/10 03:45:36 rillig Exp $
+# $NetBSD: pkg-build-options.mk,v 1.3 2007/05/07 09:26:40 rillig Exp $
#
# This procedure determines the PKG_OPTIONS that have been in effect
# when the package ${pkgbase} has been built. When the package is not
@@ -16,16 +16,16 @@
# pkgbase := wine
# .include "../../mk/pkg-build-options.mk"
#
-# TODO: Query the installed package if it exists.
-#
+
+.include "${.PARSEDIR}/bsd.fast.prefs.mk"
.if defined(BUILDLINK_DEPTH) && !empty(BUILDLINK_DEPTH)
. for b in ${pkgbase}
. if !defined(PKG_BUILD_OPTIONS.${b})
PKG_BUILD_OPTIONS.${b} != \
- cd ${BUILDLINK_PKGSRCDIR.${b}} \
- && ${MAKE} ${MAKEFLAGS} \
- show-var VARNAME=PKG_OPTIONS
+ ${PKG_INFO} -Q PKG_OPTIONS ${pkgbase} 2>/dev/null \
+ || { cd ${BUILDLINK_PKGSRCDIR.${b}} \
+ && ${MAKE} ${MAKEFLAGS} show-var VARNAME=PKG_OPTIONS; }
MAKEFLAGS+= PKG_BUILD_OPTIONS.${b}=${PKG_BUILD_OPTIONS.${b}:Q}
. endif