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
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-02-21 10:40 UTC by kamikaze
Modified: 2010-11-28 16:00 UTC (History)
0 users

See Also:


Attachments
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@:
http://docs.freebsd.org/cgi/mid.cgi?c1a0d1561002200755q4ab28515ic550fca1789e1cd8

Fix: wxs has a patch that adds the check:
http://people.freebsd.org/~wxs/package-noinstall-rc-script.diff

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,
now.

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

Regards
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 .. 

http://pointyhat.freebsd.org/errorlogs/amd64-errorlogs/a.8-exp.20101111125232/cups-1.4.4.log 

===>  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
entry.

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
cups-base-1.4.5
cups-client-1.4.5
cups-image-1.4.5
cups-pstoraster-8.15.4_6

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 @@
 .endif
 
 # Disable install
-.if defined(NO_INSTALL) && !target(install)
-install: build
-	@${TOUCH} ${TOUCH_FLAGS} ${INSTALL_COOKIE}
+.if defined(NO_INSTALL) && !target(do-install)
+do-install:
+	@${DO_NADA}
 .endif
 
 # Disable package
@@ -3883,20 +3883,7 @@
 		fi; \
 	fi
 	@__softMAKEFLAGS='${__softMAKEFLAGS:S/'/'\''/g}'; \
-	_LATE_PKG_ARGS=""; \
-	if [ -f ${PKGINSTALL} ]; then \
-		_LATE_PKG_ARGS="$${_LATE_PKG_ARGS} -i ${PKGINSTALL}"; \
-	fi; \
-	if [ -f ${PKGDEINSTALL} ]; then \
-		_LATE_PKG_ARGS="$${_LATE_PKG_ARGS} -k ${PKGDEINSTALL}"; \
-	fi; \
-	if [ -f ${PKGREQ} ]; then \
-		_LATE_PKG_ARGS="$${_LATE_PKG_ARGS} -r ${PKGREQ}"; \
-	fi; \
-	if [ -f ${PKGMESSAGE} ]; then \
-		_LATE_PKG_ARGS="$${_LATE_PKG_ARGS} -D ${PKGMESSAGE}"; \
-	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 
  Log:
  - 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
http://lists.freebsd.org/mailman/listinfo/cvs-all
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.