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.
This commit is contained in:
agc 2000-05-11 11:23:20 +00:00
parent cc4c589ad8
commit ef268dcf91
3 changed files with 29 additions and 6 deletions

View file

@ -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
===========

View file

@ -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

View file

@ -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