From owner-svn-ports-all@FreeBSD.ORG Wed Oct 2 23:49:22 2013 Return-Path: Delivered-To: svn-ports-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 9820260F; Wed, 2 Oct 2013 23:49:22 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 448A9239D; Wed, 2 Oct 2013 23:49:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r92NnM3m090751; Wed, 2 Oct 2013 23:49:22 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r92NnMsI090750; Wed, 2 Oct 2013 23:49:22 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201310022349.r92NnMsI090750@svn.freebsd.org> From: Bryan Drewery Date: Wed, 2 Oct 2013 23:49:22 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r329130 - head/Mk X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Oct 2013 23:49:22 -0000 Author: bdrewery Date: Wed Oct 2 23:49:21 2013 New Revision: 329130 URL: http://svnweb.freebsd.org/changeset/ports/329130 Log: - Fix 'package' with staging+pkg_install when ports are read-only by creating the package in STAGEDIR and then linking/copying it over to PACKAGES if possible With hat: portmgr Reviewed by: bapt (earlier version) Tested by: Stefan Bethke Reported by: many Modified: head/Mk/bsd.port.mk Modified: head/Mk/bsd.port.mk ============================================================================== --- head/Mk/bsd.port.mk Wed Oct 2 23:38:51 2013 (r329129) +++ head/Mk/bsd.port.mk Wed Oct 2 23:49:21 2013 (r329130) @@ -3876,8 +3876,10 @@ do-package: ${TMPPLIST} if [ -f ${PKGMESSAGE} ]; then \ _LATE_PKG_ARGS="$${_LATE_PKG_ARGS} -D ${PKGMESSAGE}"; \ fi; \ - if ${PKG_CMD} -S ${STAGEDIR} ${PKG_ARGS} ${PKGFILE}; then \ - if [ -d ${PACKAGES} ]; then \ + if ${PKG_CMD} -S ${STAGEDIR} ${PKG_ARGS} ${WRKDIR}/${PKGNAME}${PKG_SUFX}; then \ + if [ -d ${PACKAGES} -a -w ${PACKAGES} ]; then \ + ${LN} -f ${WRKDIR}/${PKGNAME}${PKG_SUFX} ${PKGFILE} 2>/dev/null || \ + ${CP} -af ${WRKDIR}/${PKGNAME}${PKG_SUFX} ${PKGFILE}; \ cd ${.CURDIR} && eval ${MAKE} package-links; \ fi; \ else \ @@ -3923,7 +3925,12 @@ delete-package-links: .if !target(delete-package) delete-package: delete-package-links +. if defined(NO_STAGE) @${RM} -f ${PKGFILE} +. else +# When staging, the package may only be in the workdir if not root + @${RM} -f ${PKGFILE} ${WRKDIR}/${PKGNAME}${PKG_SUFX} 2>/dev/null || : +. endif .endif .if !target(delete-package-links-list) @@ -3941,12 +3948,13 @@ delete-package-list: delete-package-link @${ECHO_CMD} "[ -f ${PKGFILE} ] && (${ECHO_CMD} deleting ${PKGFILE}; ${RM} -f ${PKGFILE})" .endif +# Only used if !defined(NO_STAGE) .if !target(install-package) install-package: .if defined(FORCE_PKG_REGISTER) - @${PKG_ADD} -f ${PKGFILE} + @${PKG_ADD} -f ${WRKDIR}/${PKGNAME}${PKG_SUFX} .else - @${PKG_ADD} ${PKGFILE} + @${PKG_ADD} ${WRKDIR}/${PKGNAME}${PKG_SUFX} .endif .endif