Details
- Reviewers
tcberner adamw yuri - Group Reviewers
O5: Ports Framework portmgr - Commits
- rP460578: Don't run create-manifest as root.
Diff Detail
- Repository
- rP FreeBSD ports repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
This problem happens when during development 'make install' fails due to, for example, a duplicate file conflict.
- It accomplishes the cleanup, which is obviously missing in this place
- Tests confirm that it solves the original problem.
So, what is exactly not right about it?
Once the make install command runs as root, it creates them with root credentials. It is possible to create them with credentials matching the work directory. But besides looking a bit stilted, this also has a downside of leaving these temporary files in case of failure.
I've run into this bug many times before. Thank you for bringing this up Yuri.
This begs the question if create-manifest really needs to be in _INSTALL_SUSEQ (as part of fake-pkg) or if it can simply be in _INSTALL_SEQ?
Something like
diff --git a/Mk/bsd.port.mk b/Mk/bsd.port.mk index 3db728b11168..cd6f75c10fd8 100644 --- a/Mk/bsd.port.mk +++ b/Mk/bsd.port.mk @@ -4671,7 +4671,7 @@ flavors-package-names: .PHONY STAGE_ARGS= -i ${STAGEDIR} .if !defined(NO_PKG_REGISTER) -fake-pkg: create-manifest +fake-pkg: .if defined(INSTALLS_DEPENDS) @${ECHO_MSG} "===> Registering installation for ${PKGNAME} as automatic" .else @@ -5410,8 +5410,9 @@ _TEST_SEQ= 100:test-message 150:test-depends 300:pre-test 500:do-test \ ${_OPTIONS_test} ${_USES_test} _INSTALL_DEP= stage _INSTALL_SEQ= 100:install-message \ - 200:check-already-installed -_INSTALL_SUSEQ= 300:fake-pkg 500:security-check + 200:check-already-installed \ + 300:create-manifest +_INSTALL_SUSEQ= 301:fake-pkg 500:security-check _PACKAGE_DEP= stage _PACKAGE_SEQ= 100:package-message 300:pre-package 450:pre-package-script \
I don't have time to review at the moment but I think you're right that it doesn't need to be in SUSEQ.