Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 9 Aug 2006 07:30:04 +0200 (CEST)
From:      Helge Oldach <mkbsdportaug06@oldach.net>
To:        FreeBSD-gnats-submit@FreeBSD.org
Cc:        Gábor Kövesdán <gabor@FreeBSD.org>, Erwin Lansing <erwin@FreeBSD.org>
Subject:   ports/101685: [patch] "make all deinstall install clean" broken
Message-ID:  <200608090530.k795U4x7009578@sep.oldach.net>
Resent-Message-ID: <200608090540.k795eB8w068790@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         101685
>Category:       ports
>Synopsis:       [patch] "make all deinstall install clean" broken
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Aug 09 05:40:10 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Helge Oldach
>Release:        FreeBSD 6.1-482 i386
>Organization:
>Environment:

System: FreeBSD localhost 6.1-482 FreeBSD 6.1-482 #0: Tue Aug 8 19:27:01 CEST 2006 toor@sep.oldach.net:/usr/obj/usr/src/sys/HMO i386

>Description:

The "usual" port re-installation procedure

# make all deinstall install clean

is broken by revision 1.539 of ports/Mk/bsd.port.mk.

The issue is caused by a change in the fake-pkg target. With rev. 1.538,
make(1) was checking at run-time, whether ${PKG_DBDIR}/${PKGNAME}
exists. Rev. 1.539 changed this back to the time when the Makefile
is evaluated. However, when re-installing an already existing port,
${PKG_DBDIR}/${PKGNAME} *does* exist at Makefile evaluation time but is
gone before the "install" target. Hence the fake-pkg target skips the
code to create a fresh ${PKG_DBDIR}/${PKGNAME}, which is wrong.

The patch below reverts to the old, correct behaviour.

Please also see ports/100555.

>How-To-Repeat:

For example:

# ls -la /var/db/pkg/spamass-rules-20060203
total 38
-rw-r--r--    1 root  wheel     33 Aug  9 07:12 +COMMENT
-rw-r--r--    1 root  wheel   5349 Aug  9 07:12 +CONTENTS
-rw-r--r--    1 root  wheel    567 Aug  9 07:12 +DESC
-rw-r--r--    1 root  wheel    654 Aug  9 07:12 +DISPLAY
-r--r--r--    1 root  wheel  15305 Aug  9 07:12 +MTREE_DIRS
drwxr-xr-x    2 root  wheel    512 Aug  9 07:12 .
drwxr-xr-x  232 root  wheel   6656 Aug  9 07:12 ..
# cd /usr/ports/mail/spamass-rules
# make all deinstall install clean
===>  Vulnerability check disabled, database not found
===>  Found saved configuration for spamass-rules-20060203
===>  Extracting for spamass-rules-20060203
=> MD5 Checksum OK for spamass-rules-20060203.tar.bz2.
=> SHA256 Checksum OK for spamass-rules-20060203.tar.bz2.
===>  Patching for spamass-rules-20060203
===>  Configuring for spamass-rules-20060203
===>  Deinstalling for mail/spamass-rules
===>   Deinstalling spamass-rules-20060203
===>  Installing for spamass-rules-20060203
===>   spamass-rules-20060203 depends on executable in : spamc - found
===>   Generating temporary packing list
===>  Checking if mail/spamass-rules already installed
*************************************************************************

The custom rulesets are installed in /usr/local/etc/mail/spamassassin

Before running these rules please do the following:

1. Read any extra info available with the rules, including the comments
   in the .cf files.
2. Check to make sure that the default scores in these rules fit your
   installation. You might want to modify scores.
3. Make sure to --lint the rules after loading them.
4. Test the new rulesets. Keep an eye on hits from the new rules to
   determine if the scoring is right for you.

*************************************************************************
cp: /var/db/pkg/spamass-rules-20060203/+MTREE_DIRS: No such file or directory
*** Error code 1

Stop in /usr/ports/mail/spamass-rules.
# 

>Fix:

--- bsd.port.mk.ctm	Sat Aug  5 00:46:27 2006
+++ bsd.port.mk	Wed Aug  9 07:17:23 2006
@@ -5581,7 +5581,7 @@
 	fi
 	@${RM} -rf ${PKG_DBDIR}/${PKGNAME}
 .endif
-.if !exists(${PKG_DBDIR}/${PKGNAME})
+	@if [ ! -d ${PKG_DBDIR}/${PKGNAME} ]; then \
 .if !defined(DESTDIR)
 		@${ECHO_MSG} "===>   Registering installation for ${PKGNAME}"
 .else
@@ -5610,8 +5610,8 @@
 					${ECHO_CMD} ${PKGNAME} >> ${PKG_DBDIR}/$$dep/+REQUIRED_BY; \
 				fi; \
 			fi; \
-		done
-.endif
+		done; \
+	fi
 .if !defined(NO_MTREE)
 	@if [ -f ${MTREE_FILE} ]; then \
 		${CP} ${MTREE_FILE} ${PKG_DBDIR}/${PKGNAME}/+MTREE_DIRS; \

>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200608090530.k795U4x7009578>