diff options
author | agc <agc> | 2000-05-11 11:23:20 +0000 |
---|---|---|
committer | agc <agc> | 2000-05-11 11:23:20 +0000 |
commit | ec26c4149c3527b37196ac4c497979b8eac0a0cd (patch) | |
tree | de5a4d036cc6edfdf2c22ea44905ce89195d2082 | |
parent | f7d77a1d734dab0a87592809a0fc26ad7c597db5 (diff) | |
download | pkgsrc-ec26c4149c3527b37196ac4c497979b8eac0a0cd.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.
-rw-r--r-- | Packages.txt | 10 | ||||
-rw-r--r-- | mk/bsd.pkg.mk | 19 | ||||
-rw-r--r-- | mk/bsd.pkg.subdir.mk | 6 |
3 files changed, 29 insertions, 6 deletions
diff --git a/Packages.txt b/Packages.txt index 296d646dc8b..b9a38769eff 100644 --- a/Packages.txt +++ b/Packages.txt @@ -1,4 +1,4 @@ -# $NetBSD: Packages.txt,v 1.84 2000/04/20 16:06:23 jdolecek Exp $ +# $NetBSD: Packages.txt,v 1.85 2000/05/11 11:23:20 agc Exp $ ########################################################################### ========================== @@ -1135,6 +1135,14 @@ perform the equivalent of: be used to show which of your installed packages are downlevel, and so the old versions can be deleted, and the current ones added. + * show-pkgsrc-dir: + This target shows the directory in the pkgsrc hierarchy from which the + package can be built and installed. This may not be the same directory + as the one from which the package was installed. This target is intended + to be used by people who may wish to upgrade many packages on a single + host, and can be invoked from the top-level pkgsrc Makefile by using the + target "show-specific-pkgs" + 8 Debugging =========== 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 |