aboutsummaryrefslogtreecommitdiffstats
path: root/Mk
diff options
context:
space:
mode:
authorbdrewery <bdrewery@FreeBSD.org>2014-03-23 23:21:42 +0800
committerbdrewery <bdrewery@FreeBSD.org>2014-03-23 23:21:42 +0800
commit87ad1777b69558d67bda8457b68589fbba66f7e9 (patch)
tree9665b0b794680b44b9005bef6a9108dfb61d271b /Mk
parent0b318959978aa14ce33d9cf1adf71ae2cd55f27c (diff)
downloadfreebsd-ports-gnome-87ad1777b69558d67bda8457b68589fbba66f7e9.tar.gz
freebsd-ports-gnome-87ad1777b69558d67bda8457b68589fbba66f7e9.tar.zst
freebsd-ports-gnome-87ad1777b69558d67bda8457b68589fbba66f7e9.zip
- pkgng: Create package in WRKDIR and then try to link it to the PACKAGES dir.
If that fails, copy it. This fixes packaging as non-root when not able to write to the PACKAGES dir which causes the following warning: pkg-static: archive_write_open_filename(/usr/ports/packages/All/myport-1.2.3.txz): Bad file descriptor We do the same thing for pkg_install already. With hat: portmgr
Diffstat (limited to 'Mk')
-rw-r--r--Mk/bsd.pkgng.mk6
1 files changed, 5 insertions, 1 deletions
diff --git a/Mk/bsd.pkgng.mk b/Mk/bsd.pkgng.mk
index 9c19f9895159..f3e47b1fb12f 100644
--- a/Mk/bsd.pkgng.mk
+++ b/Mk/bsd.pkgng.mk
@@ -245,7 +245,11 @@ do-package: ${TMPPLIST}
@for cat in ${CATEGORIES}; do \
${RM} -f ${PACKAGES}/$$cat/${PKGNAMEPREFIX}${PORTNAME}*${PKG_SUFX} ; \
done
- @if ${SETENV} FORCE_POST="${_FORCE_POST_PATTERNS}" ${PKG_CREATE} ${PKG_CREATE_ARGS} -o ${PKGREPOSITORY} ${PKGNAME}; then \
+ @if ${SETENV} FORCE_POST="${_FORCE_POST_PATTERNS}" ${PKG_CREATE} ${PKG_CREATE_ARGS} -o ${WRKDIR} ${PKGNAME}; then \
+ if [ -d ${PKGREPOSITORY} -a -w ${PKGREPOSITORY} ]; then \
+ ${LN} -f ${WRKDIR}/${PKGNAME}${PKG_SUFX} ${PKGFILE} 2>/dev/null \
+ || ${CP} -af ${WRKDIR}/${PKGNAME}${PKG_SUFX} ${PKGFILE}; \
+ fi; \
if [ "${PKGORIGIN}" = "ports-mgmt/pkg" -o "${PKGORIGIN}" = "ports-mgmt/pkg-devel" ]; then \
if [ ! -d ${PKGLATESTREPOSITORY} ]; then \
if ! ${MKDIR} ${PKGLATESTREPOSITORY}; then \