Bug 182347

Summary: ports-mgmt/pkg: install target does nothing for pkgng + staging + NO_PKG_REGISTER case
Product: Ports & Packages Reporter: Dmitry Marakasov <amdmi3>
Component: Individual Port(s)Assignee: pkg
Status: In Progress ---    
Severity: Affects Only Me CC: bapt, miwi
Priority: Normal Keywords: needs-staging
Version: Latest   
Hardware: Any   
OS: Any   

Description Dmitry Marakasov freebsd_committer 2013-09-24 14:40:00 UTC
When pkgng is used and the port supports staging, `make install` with NO_PKG_REGISTER set does nothing - no files are installed to the system.

This seeminlgy happens because the package installation and pkgdb registration are now done in the same time with pkg, and whole fake-pkg target which runs this pkg is wrapped in .if !defined(NO_PKG_REGISTER):

---
fake-pkg: create-manifest
.if !defined(NO_PKG_REGISTER)
.if defined(INSTALLS_DEPENDS)
    @${ECHO_MSG} "===>   Registering installation for ${PKGNAME} as automatic"
.else
    @${ECHO_MSG} "===>   Registering installation for ${PKGNAME}"
.endif
.if defined(INSTALLS_DEPENDS)
    @${SETENV} FORCE_POST="${_FORCE_POST_PATTERNS}" ${PKG_CMD} -d ${STAGE_ARGS} -m ${METADIR} -f ${TMPPLIST}
.else
    @${SETENV} FORCE_POST="${_FORCE_POST_PATTERNS}" ${PKG_CMD} ${STAGE_ARGS} -m ${METADIR} -f ${TMPPLIST}
.endif
    @${RM} -rf ${METADIR}
.else
    @${DO_NADA}
.endif
.endif
---

Fix: 

Likely a mode needs to be added to pkg which does installation but not registration, and it should be used in pkgng.mk

Also, this probably may be achieved with using -l argument of `pkg register` and fake PKG_DBDIR, but I haven't tested.
How-To-Repeat: Try `make install` any port with NO_PKG_REGISTER.
Comment 1 Alex Kozlov freebsd_committer 2013-10-02 07:44:29 UTC
Responsible Changed
From-To: freebsd-ports-bugs->portmgr

Over to maintainer.
Comment 2 John Marino freebsd_committer 2014-08-31 10:37:22 UTC
If this PR is no longer valid, it would be nice to get it closed.  It shows in a search for unstaged ports.
Comment 3 Dmitry Marakasov freebsd_committer 2014-08-31 12:50:02 UTC
The PR is valid. Ports are still not installed.
Comment 4 Martin Wilke freebsd_committer 2016-01-17 15:08:21 UTC
(In reply to Dmitry Marakasov from comment #3)
Hi,

Its 2016 still the same problem?
Comment 5 Dmitry Marakasov freebsd_committer 2016-01-26 16:11:45 UTC
Yes. You can reproduce it with

WRKDIRPREFIX=/tmp/work PREFIX=/tmp/usr NO_PKG_REGISTER=1 INSTALL_AS_USER=1 make -C /usr/ports/archivers/zip clean install

After it there's no /tmp/usr.