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: freebsd-pkg (Nobody) <pkg>
Status: Open ---    
Severity: Affects Only Me CC: bapt, miwi, w.schwarzenfeld
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)
    @${ECHO_MSG} "===>   Registering installation for ${PKGNAME} as automatic"
    @${ECHO_MSG} "===>   Registering installation for ${PKGNAME}"
    @${RM} -rf ${METADIR}


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)

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.
Comment 6 Walter Schwarzenfeld freebsd_triage 2018-01-12 01:22:50 UTC
Any advance here?
Comment 7 Mark Linimon freebsd_committer freebsd_triage 2020-07-25 23:34:05 UTC
^Triage: this does not currently appear to be "in progress".