git: 12d7dba8b2e1 - main - archivers/py-borgbackup*: staging without HOME

From: Matthias Andree <mandree_at_FreeBSD.org>
Date: Sat, 03 Sep 2022 18:50:24 UTC
The branch main has been updated by mandree:

URL: https://cgit.FreeBSD.org/ports/commit/?id=12d7dba8b2e1b11e76dd0ae5c5c60ed3da45a50e

commit 12d7dba8b2e1b11e76dd0ae5c5c60ed3da45a50e
Author:     Matthias Andree <mandree@FreeBSD.org>
AuthorDate: 2022-09-03 18:47:24 +0000
Commit:     Matthias Andree <mandree@FreeBSD.org>
CommitDate: 2022-09-03 18:50:19 +0000

    archivers/py-borgbackup*: staging without HOME
    
    Building as non-root often inherits the "nobody" user's would-be home
    directory, "/nonexistent", which is just that. Provide something blank
    in the WRKDIR instead.
    
    Reported by:    Juraj Lutter (otis@)
    
    Unrelated to, but still mentioned for...
    PR:             264816
---
 archivers/py-borgbackup/Makefile   | 6 ++++--
 archivers/py-borgbackup11/Makefile | 6 ++++--
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/archivers/py-borgbackup/Makefile b/archivers/py-borgbackup/Makefile
index ae58736a81ad..9c140f4641f2 100644
--- a/archivers/py-borgbackup/Makefile
+++ b/archivers/py-borgbackup/Makefile
@@ -33,13 +33,15 @@ OPTIONS_DEFAULT=	FUSE
 FUSE_DESC=	Support to mount locally borg backup files
 FUSE_RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}llfuse>0:devel/py-llfuse@${PY_FLAVOR}
 
-_BORGENV=BORG_PASSPHRASE=secret123 PYTHONPATH=${STAGEDIR}${PYTHON_SITELIBDIR}
+_BORGHOME=${WRKDIR}/testhome
+_BORGENV=BORG_PASSPHRASE=secret123 PYTHONPATH=${STAGEDIR}${PYTHON_SITELIBDIR} HOME=${_BORGHOME}
 post-install:
 	${MKDIR} ${STAGEDIR}${MAN1PREFIX}/share/man/man1/
 	${INSTALL_MAN} ${WRKSRC}/docs/man/* ${STAGEDIR}${MAN1PREFIX}/share/man/man1/
-	@${FIND} ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}/borg/ -name "*.so" \
+	${FIND} ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}/borg/ -name "*.so" \
 		-exec ${STRIP_CMD} {} \;
 	@${ECHO_MSG} "----> running borg smoke tests"
+	${MKDIR} ${_BORGHOME}
 	${SETENV} PYTHONPATH=${STAGEDIR}${PYTHON_SITELIBDIR} ${STAGEDIR}${PREFIX}/bin/borg -V
 	${RM} -r ${WRKDIR}/borgrepo
 	${SETENV} ${_BORGENV} ${STAGEDIR}${PREFIX}/bin/borg init --encryption=repokey ${WRKDIR}/borgrepo
diff --git a/archivers/py-borgbackup11/Makefile b/archivers/py-borgbackup11/Makefile
index ec282fca19d4..0ceafffc2471 100644
--- a/archivers/py-borgbackup11/Makefile
+++ b/archivers/py-borgbackup11/Makefile
@@ -33,13 +33,15 @@ OPTIONS_DEFAULT=	FUSE
 FUSE_DESC=	Support to mount locally borg backup files
 FUSE_RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}llfuse>0:devel/py-llfuse@${PY_FLAVOR}
 
-_BORGENV=BORG_PASSPHRASE=secret123 PYTHONPATH=${STAGEDIR}${PYTHON_SITELIBDIR}
+_BORGHOME=${WRKDIR}/testhome
+_BORGENV=BORG_PASSPHRASE=secret123 PYTHONPATH=${STAGEDIR}${PYTHON_SITELIBDIR} HOME=${_BORGHOME}
 post-install:
 	${MKDIR} ${STAGEDIR}${MAN1PREFIX}/share/man/man1/
 	${INSTALL_MAN} ${WRKSRC}/docs/man/* ${STAGEDIR}${MAN1PREFIX}/share/man/man1/
-	@${FIND} ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}/borg/ -name "*.so" \
+	${FIND} ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}/borg/ -name "*.so" \
 		-exec ${STRIP_CMD} {} \;
 	@${ECHO_MSG} "----> running borg smoke tests"
+	${MKDIR} ${_BORGHOME}
 	${SETENV} PYTHONPATH=${STAGEDIR}${PYTHON_SITELIBDIR} ${STAGEDIR}${PREFIX}/bin/borg -V
 	${RM} -r ${WRKDIR}/borgrepo
 	${SETENV} ${_BORGENV} ${STAGEDIR}${PREFIX}/bin/borg init --encryption=repokey ${WRKDIR}/borgrepo