summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorrillig <rillig>2007-05-07 09:26:40 +0000
committerrillig <rillig>2007-05-07 09:26:40 +0000
commit9050fafe2bf48ab72f3184e51b505a5e44fe261a (patch)
treee52e35a7f6127d2619ef291d7468c03bac3ad92e /mk
parent225d2e88fbc969bab10140654bb60433a3deaa6f (diff)
downloadpkgsrc-9050fafe2bf48ab72f3184e51b505a5e44fe261a.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')
-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