Bug 144164 - make package-noinstall does not include rc.d scripts
Summary: make package-noinstall does not include rc.d scripts
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Pav Lucistnik
Depends on:
Reported: 2010-02-21 10:40 UTC by kamikaze
Modified: 2010-11-28 16:00 UTC (History)
0 users

See Also:

file.diff (831 bytes, patch)
2010-02-21 10:40 UTC, kamikaze
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description kamikaze 2010-02-21 10:40:02 UTC
The package-noinstall target does not include rc.d scripts, because it does not ensure that RC scripts have been added to the TMPPLIST file.

See also the mailing list thread in ports@:

Fix: wxs has a patch that adds the check:

I instead propose to remove this functionality from bsd.port.mk and instead rely on "pkg_create -b".

Patch attached with submission follows:
How-To-Repeat: Run "make package-noinstall" for a port that installs an rc.d script. Make sure that the work directory is clean before you do so.

tar -tf /usr/ports/packages/All/pkgname.tbz
will show you that the rc.d script is missing.
Comment 1 Martin Wilke freebsd_committer 2010-02-22 10:58:39 UTC
Responsible Changed
From-To: freebsd-ports-bugs->miwi

I'll take it.
Comment 2 Martin Wilke freebsd_committer 2010-02-22 19:56:31 UTC
Responsible Changed
From-To: miwi->portmgr

over to portmgr.
Comment 3 kamikaze 2010-09-07 14:57:45 UTC
I have a nice tinderbox with a quad-core and 8-GB of RAM at home,

What should I build (with and without the patch) to demonstrate
you that this does not introduce regressions?

Comment 4 Pav Lucistnik freebsd_committer 2010-11-11 12:52:01 UTC
Responsible Changed
From-To: portmgr->pav

Take for exp-run
Comment 5 Pav Lucistnik freebsd_committer 2010-11-12 20:32:46 UTC
State Changed
From-To: open->feedback

This breaks certain metaports .. 


===>  Building package for cups-1.4.4 
===>   Generating temporary packing list 
pkg_create: can't find package 'cups-1.4.4' installed! 
*** Error code 1
Comment 6 kamikaze 2010-11-16 12:34:06 UTC
I looked into this. The error is my assumption that `make install`
always results in an entry in PKG_DBDIR.

As it turns out, this is wrong. print/cups has NO_INSTALL set and
installing it from the ports does not result in an a PKG_DBDIR

This is results in some oddities, like you can install print/cups
for an infinite amount of times, because it will never actually
be installed. And of course pkg_info does not list cups, right
after installing it:

# cd /usr/ports/print/cups
# make clean
===>  Cleaning for cups-1.4.5
# make install
===>  License check disabled, port has not defined LICENSE
===>  Extracting for cups-1.4.5
===>  Patching for cups-1.4.5
===>   cups-1.4.5 depends on executable: espgs - found
===>   cups-1.4.5 depends on executable: cupsd - found
===>  Configuring for cups-1.4.5
# pkg_info -Ex cups

So the only way to install a meta-port that defines NO_INSTALL
is to install the package. My suggestion is to change the behaviour
of NO_INSTALL to something I consider more consistent.

My tinderbox is still running, two builds have already completed
cups-1.4.5 with the updated patch:

diff -u bsd.port.mk.orig bsd.port.mk
--- bsd.port.mk.orig	2010-11-16 12:59:45.000000000 +0100
+++ bsd.port.mk	2010-11-16 12:57:51.000000000 +0100
@@ -3411,9 +3411,9 @@
 # Disable install
-.if defined(NO_INSTALL) && !target(install)
-install: build
+.if defined(NO_INSTALL) && !target(do-install)
+	@${DO_NADA}
 # Disable package
@@ -3883,20 +3883,7 @@
 		fi; \
 	@__softMAKEFLAGS='${__softMAKEFLAGS:S/'/'\''/g}'; \
-	_LATE_PKG_ARGS=""; \
-	if [ -f ${PKGINSTALL} ]; then \
-	fi; \
-	if [ -f ${PKGDEINSTALL} ]; then \
-	fi; \
-	if [ -f ${PKGREQ} ]; then \
-	fi; \
-	if [ -f ${PKGMESSAGE} ]; then \
-	fi; \
-	if ${PKG_CMD} ${PKG_ARGS} ${PKGFILE}; then \
+	if ${PKG_CMD} -b ${PKGNAME} ${PKGFILE}; then \
 		if [ -d ${PACKAGES} ]; then \
 			cd ${.CURDIR} && eval ${MAKE} $${__softMAKEFLAGS} package-links; \
 		fi; \
Comment 7 Pav Lucistnik freebsd_committer 2010-11-16 13:01:15 UTC
State Changed
From-To: feedback->open

New patch received
Comment 9 Pav Lucistnik freebsd_committer 2010-11-24 23:01:57 UTC
State Changed
From-To: open->closed

Committed, thanks!
Comment 10 dfilter service freebsd_committer 2010-11-24 23:04:06 UTC
pav         2010-11-24 23:04:02 UTC

  FreeBSD ports repository

  Modified files:
    Mk                   bsd.port.mk 
  - Fix NO_INSTALL ports to register an entry in /var/db/pkg (ie. print/cups)
  - Change package-noinstall target to create package with pkg_create -b instead
    of specifying all the arguments
  PR:             ports/144164
  Submitted by:   Dominic Fandrey <kamikaze@bsdforen.de>
  Revision  Changes    Path
  1.656     +5 -18     ports/Mk/bsd.port.mk
cvs-all@freebsd.org mailing list
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 11 Olli Hauer freebsd_committer 2010-11-28 15:51:54 UTC
This patch has one dark side.

The pkg-message will no longer displayed if you install from package,
(has me driven crazy until I recognized the issue with this patch).

You can test this easily by installing a package which displays a
pkg-message and was build with and without this patch.

I opened PR 152626 about this behavior, hopefully the issue
will be resolved before ports freeze.