Date: Tue, 25 Jun 2013 12:24:10 +0000 (UTC) From: Baptiste Daroussin <bapt@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r321737 - head/Mk Message-ID: <201306251224.r5PCOATs097662@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: bapt Date: Tue Jun 25 12:24:10 2013 New Revision: 321737 URL: http://svnweb.freebsd.org/changeset/ports/321737 Log: 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 Modified: head/Mk/bsd.pkgng.mk head/Mk/bsd.port.mk Modified: head/Mk/bsd.pkgng.mk ============================================================================== --- head/Mk/bsd.pkgng.mk Tue Jun 25 12:10:02 2013 (r321736) +++ head/Mk/bsd.pkgng.mk Tue Jun 25 12:24:10 2013 (r321737) @@ -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) Modified: head/Mk/bsd.port.mk ============================================================================== --- head/Mk/bsd.port.mk Tue Jun 25 12:10:02 2013 (r321736) +++ head/Mk/bsd.port.mk Tue Jun 25 12:24:10 2013 (r321737) @@ -1628,6 +1628,10 @@ PATCH_DEPENDS+= ${LOCALBASE}/bin/unzip: .endif .endif +.if !defined(UID) +UID!= ${ID} -u +.endif + # Check the compatibility layer for amd64/ia64 .if ${ARCH} == "amd64" || ${ARCH} =="ia64" @@ -2308,9 +2312,6 @@ MTREE_ARGS?= -U ${MTREE_FOLLOWS_SYMLINKS READLINK_CMD?= /usr/bin/readlink # Determine whether or not we can use rootly owner/group functions. -.if !defined(UID) -UID!= ${ID} -u -.endif .if ${UID} == 0 _BINOWNGRP= -o ${BINOWN} -g ${BINGRP} _SHROWNGRP= -o ${SHAREOWN} -g ${SHAREGRP}
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201306251224.r5PCOATs097662>