From f5ce2acf3c03f8194cb8d9ccaee364181105f291 Mon Sep 17 00:00:00 2001 From: tron Date: Sat, 3 Apr 1999 21:03:50 +0000 Subject: Use "su" automatically for "make deinstall" target, too. --- mk/bsd.pkg.mk | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/mk/bsd.pkg.mk b/mk/bsd.pkg.mk index ea624e40fcc..1f2f189103d 100644 --- a/mk/bsd.pkg.mk +++ b/mk/bsd.pkg.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.pkg.mk,v 1.242 1999/04/02 21:14:12 agc Exp $ +# $NetBSD: bsd.pkg.mk,v 1.243 1999/04/03 21:03:50 tron Exp $ # # This file is in the public domain. # @@ -1539,8 +1539,19 @@ reinstall: # Special target to remove installation .if !target(deinstall) -deinstall: uptodate-pkgtools +deinstall: pkg-su-deinstall + +pkg-su-deinstall: uptodate-pkgtools @${ECHO_MSG} "===> Deinstalling for ${PKGNAME}" + ${_PKG_SILENT}${_PKG_DEBUG} \ + if [ `${ID} -u` = 0 ]; then \ + ${MAKE} ${.MAKEFLAGS} root-deinstall; \ + else \ + ${ECHO_MSG} "Becoming root to deinstall ${PKGNAME}.";\ + ${SU_CMD} "cd ${.CURDIR}; ${MAKE} ${.MAKEFLAGS} root-deinstall"; \ + fi + +root-deinstall: .ifdef PKG_VERBOSE ${_PKG_SILENT}${_PKG_DEBUG}${PKG_DELETE} -v ${PKGNAME} || ${TRUE} .else -- cgit v1.2.3