diff options
author | agc <agc> | 2000-05-11 11:23:20 +0000 |
---|---|---|
committer | agc <agc> | 2000-05-11 11:23:20 +0000 |
commit | 856fe6cecf95a5e5cb940d59eb37778e3ed044ab (patch) | |
tree | de5a4d036cc6edfdf2c22ea44905ce89195d2082 /mk | |
parent | 7bcf10fc1d4585b3d155bb9a8686680af4802f3e (diff) | |
download | pkgsrc-856fe6cecf95a5e5cb940d59eb37778e3ed044ab.tar.gz |
Define a new target, "show-pkgsrc-dir", which prints the directory
from which an installed package can be re-installed. This can be used
to build up a list of host specific packages, which is useful, for
example, in re-building all packages on a machine for a.out to ELF
transition.
Diffstat (limited to 'mk')
-rw-r--r-- | mk/bsd.pkg.mk | 19 | ||||
-rw-r--r-- | mk/bsd.pkg.subdir.mk | 6 |
2 files changed, 20 insertions, 5 deletions
diff --git a/mk/bsd.pkg.mk b/mk/bsd.pkg.mk index 55c10dd41ac..8a5db14644d 100644 --- a/mk/bsd.pkg.mk +++ b/mk/bsd.pkg.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.pkg.mk,v 1.434 2000/05/11 08:14:35 agc Exp $ +# $NetBSD: bsd.pkg.mk,v 1.435 2000/05/11 11:23:22 agc Exp $ # # This file is in the public domain. # @@ -1141,7 +1141,7 @@ show-downlevel: .else ${_PKG_SILENT}${_PKG_DEBUG} \ base=`${ECHO} ${PKGNAME} | ${SED} -e 's/-\([^-]*\)$$/<\1/'`; \ - found=`${PKG_INFO} -e "$$base" || ${TRUE}`; \ + found=`${PKG_INFO} -e "$$base" || ${TRUE}`; \ if [ "X$$found" != "X" -a "X$$found" != "X${PKGNAME}" ]; then \ base=`${ECHO} $$base | ${SED} -e 's/<[^<]*$$//'`; \ ${ECHO} "$$base package: $$found installed, pkgsrc version ${PKGNAME}"; \ @@ -1149,6 +1149,21 @@ show-downlevel: .endif .endif +.if !target(show-pkgsrc-dir) +show-pkgsrc-dir: +.if defined(IGNORE) + ${_PKG_SILENT}${_PKG_DEBUG}${DO_NADA} +.else + ${_PKG_SILENT}${_PKG_DEBUG} \ + base=`${ECHO} ${PKGNAME} | ${SED} -e 's|\(.*\)-.*|\1|'`; \ + found=`${PKG_INFO} -e "$$base" || ${TRUE}`; \ + if [ "X$$found" != "X" ]; then \ + pkgsrcdir=`(cd ../.. && /bin/pwd)`; \ + ${ECHO} "`pwd | ${SED} -e 's|^'$$pkgsrcdir'/||'`"; \ + fi +.endif +.endif + # Extract diff --git a/mk/bsd.pkg.subdir.mk b/mk/bsd.pkg.subdir.mk index 2e39aacd857..a95ca9d742e 100644 --- a/mk/bsd.pkg.subdir.mk +++ b/mk/bsd.pkg.subdir.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.pkg.subdir.mk,v 1.33 1999/12/15 15:52:17 abs Exp $ +# $NetBSD: bsd.pkg.subdir.mk,v 1.34 2000/05/11 11:23:22 agc Exp $ # Derived from: FreeBSD Id: bsd.port.subdir.mk,v 1.19 1997/03/09 23:10:56 wosch Exp # from: @(#)bsd.subdir.mk 5.9 (Berkeley) 2/1/91 # @@ -104,8 +104,8 @@ ${SUBDIR}:: .for __target in all fetch fetch-list package extract configure build clean \ cleandir distclean depend describe reinstall tags checksum \ - makepatchsum \ - mirror-distfiles deinstall show-downlevel ${PKG_MISC_TARGETS} + makepatchsum mirror-distfiles deinstall show-downlevel \ + show-pkgsrc-dir ${PKG_MISC_TARGETS} .if !target(__target) ${__target}: _SUBDIRUSE .endif |