mv _cache_fragment to pkgpath.mk

create a new category of recursive targets that can use this fragment,
and use them, e.g., print-package-signature from top-level should benefit
a lot.
This commit is contained in:
espie 2011-11-19 11:33:39 +00:00
parent ea06b18ae6
commit cb960e35d0
3 changed files with 24 additions and 17 deletions

View File

@ -1,6 +1,6 @@
#-*- mode: Makefile; tab-width: 4; -*-
# ex:ts=4 sw=4 filetype=make:
# $OpenBSD: bsd.port.mk,v 1.1135 2011/11/18 11:01:47 espie Exp $
# $OpenBSD: bsd.port.mk,v 1.1136 2011/11/19 11:33:39 espie Exp $
# $FreeBSD: bsd.port.mk,v 1.264 1996/12/25 02:27:44 imp Exp $
# $NetBSD: bsd.port.mk,v 1.62 1998/04/09 12:47:02 hubertf Exp $
#
@ -1589,15 +1589,6 @@ _emit_run_depends = for i in ${RUN_DEPENDS${SUBPACKAGE}:QL}; do echo "$$i"; done
# computing libraries from the ports tree is expensive, so cache as many of
# these as we can
# the cache may be filled in as root, so try to remove as normal user, THEN
# sudo only if it fails.
_cache_fragment = \
case X$${_DEPENDS_CACHE} in \
X) _DEPENDS_CACHE=`mktemp -d /tmp/dep_cache.XXXXXXXXX|| exit 1`; \
export _DEPENDS_CACHE; \
trap "rm -rf 2>/dev/null $${_DEPENDS_CACHE} || ${SUDO} rm -rf $${_DEPENDS_CACHE}" 0 1 2 3 13 15;; \
esac; PKGPATH=${PKGPATH}; export PKGPATH
# XXX assumes it's running under _cache_fragment, either directly, or from
# a target up there

View File

@ -1,7 +1,7 @@
#-*- mode: Makefile; tab-width: 4; -*-
# ex:ts=4 sw=4 filetype=make:
# from: @(#)bsd.subdir.mk 5.9 (Berkeley) 2/1/91
# $OpenBSD: bsd.port.subdir.mk,v 1.100 2011/09/24 07:36:03 espie Exp $
# $OpenBSD: bsd.port.subdir.mk,v 1.101 2011/11/19 11:33:39 espie Exp $
# FreeBSD Id: bsd.port.subdir.mk,v 1.20 1997/08/22 11:16:15 asami Exp
#
# The include file <bsd.port.subdir.mk> contains the default targets
@ -159,6 +159,12 @@ ${__target}:
@${_depfile_fragment}; echo_msg=:; ${_subdir_fragment}
.endfor
.for __target in ${_recursive_cache_targets}
${__target}:
@${_cache_fragment}; echo_msg=:; ${_subdir_fragment}
.endfor
clean:
.if defined(clean) && ${clean:L:Mdepends}
@{ target=all-dir-depends; echo_msg=:; \

View File

@ -1,4 +1,4 @@
# $OpenBSD: pkgpath.mk,v 1.39 2011/11/17 17:53:22 espie Exp $
# $OpenBSD: pkgpath.mk,v 1.40 2011/11/19 11:33:39 espie Exp $
# ex:ts=4 sw=4 filetype=make:
# pkgpath.mk - 2003 Marc Espie
# This file is in the public domain.
@ -94,6 +94,15 @@ _depfile_fragment = \
trap "rm -f $${_DEPENDS_FILE}" 0 1 2 3 13 15;; \
esac
# the cache may be filled in as root, so try to remove as normal user, THEN
# sudo only if it fails.
_cache_fragment = \
case X$${_DEPENDS_CACHE} in \
X) _DEPENDS_CACHE=`mktemp -d /tmp/dep_cache.XXXXXXXXX|| exit 1`; \
export _DEPENDS_CACHE; \
trap "rm -rf 2>/dev/null $${_DEPENDS_CACHE} || ${SUDO} rm -rf $${_DEPENDS_CACHE}" 0 1 2 3 13 15;; \
esac; PKGPATH=${PKGPATH}; export PKGPATH
HTMLIFY = sed -e 's/&/\&amp;/g' -e 's/>/\&gt;/g' -e 's/</\&lt;/g'
_MAKE = cd ${.CURDIR} && PKGPATH=${PKGPATH} exec ${MAKE}
@ -114,12 +123,10 @@ _recursive_targets = \
full-regress-depends full-run-depends \
install install-all lib-depends-check \
license-check link-categories manpages-check package patch \
port-lib-depends-check prepare print-package-signature repackage \
regress reinstall \
prepare repackage regress reinstall \
unlink-categories update update-or-install update-or-install-all \
describe dump-vars homepage-links print-plist print-plist-all \
print-plist-all-with-depends print-plist-contents print-plist-libs \
print-plist-with-depends print-plist-libs-with-depends \
print-plist-contents print-plist-libs \
show verbose-show show-size show-fake-size \
check-register check-register-all
@ -128,4 +135,7 @@ _dangerous_recursive_targets = \
_recursive_depends_targets = \
all-dir-depends build-dir-depends regress-dir-depends run-dir-depends
_recursive_cache_targets = \
print-plist-with-depends print-plist-libs-with-depends \
print-plist-all-with-depends print-package-signature \
port-lib-depends-check