diff options
author | bapt <bapt@FreeBSD.org> | 2013-06-25 20:24:10 +0800 |
---|---|---|
committer | bapt <bapt@FreeBSD.org> | 2013-06-25 20:24:10 +0800 |
commit | e06d9440a853bfa7e9b6bc6b81e626f4868ab114 (patch) | |
tree | e5440ad6a526eb296063000d16637e87751c474d /Mk/bsd.pkgng.mk | |
parent | 9939776a0b6c095df0099acd275dc325a2233661 (diff) | |
download | freebsd-ports-gnome-e06d9440a853bfa7e9b6bc6b81e626f4868ab114.tar.gz freebsd-ports-gnome-e06d9440a853bfa7e9b6bc6b81e626f4868ab114.tar.zst freebsd-ports-gnome-e06d9440a853bfa7e9b6bc6b81e626f4868ab114.zip |
Define UID earlier so that it can be used inside bsd.pkng.mk
Allow make deinstall to prompt for su if run as a user if using pkgng
Reported by: jhb, dim
Submitted by: jhb
Diffstat (limited to 'Mk/bsd.pkgng.mk')
-rw-r--r-- | Mk/bsd.pkgng.mk | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Mk/bsd.pkgng.mk b/Mk/bsd.pkgng.mk index 51001c8138e1..79148791edb3 100644 --- a/Mk/bsd.pkgng.mk +++ b/Mk/bsd.pkgng.mk @@ -262,6 +262,12 @@ check-already-installed: .if !target(deinstall) deinstall: +.if ${UID} != 0 && !defined(INSTALL_AS_USER) + @${ECHO_MSG} "===> Switching to root credentials for '${.TARGET}' target" + @cd ${.CURDIR} && \ + ${SU_CMD} "${MAKE} ${.TARGET}" + @${ECHO_MSG} "===> Returning to user credentials" +.else @${ECHO_MSG} "===> Deinstalling for ${PKGORIGIN}" @if ${PKG_INFO} -e ${PKGORIGIN}; then \ p=`${PKG_INFO} -q ${PKGORIGIN}`; \ @@ -272,5 +278,6 @@ deinstall: fi @${RM} -f ${INSTALL_COOKIE} ${PACKAGE_COOKIE} .endif +.endif .endif # defined(_POSTMKINCLUDED) |