From sunpoet@sunpoet.net  Thu Oct 28 14:55:12 2010
Return-Path: <sunpoet@sunpoet.net>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4ED6C106564A
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 28 Oct 2010 14:55:12 +0000 (UTC)
	(envelope-from sunpoet@sunpoet.net)
Received: from mail-qw0-f54.google.com (mail-qw0-f54.google.com [209.85.216.54])
	by mx1.freebsd.org (Postfix) with ESMTP id 085158FC15
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 28 Oct 2010 14:55:11 +0000 (UTC)
Received: by qwg8 with SMTP id 8so7732qwg.13
        for <FreeBSD-gnats-submit@freebsd.org>; Thu, 28 Oct 2010 07:55:11 -0700 (PDT)
Received: by 10.224.197.5 with SMTP id ei5mr4373261qab.283.1288277711140;
        Thu, 28 Oct 2010 07:55:11 -0700 (PDT)
Received: from sunpoet.net (sunpoet.net [220.133.12.240])
        by mx.google.com with ESMTPS id s28sm1106457qcp.45.2010.10.28.07.55.09
        (version=TLSv1/SSLv3 cipher=RC4-MD5);
        Thu, 28 Oct 2010 07:55:10 -0700 (PDT)
Received: by sunpoet.net (Postfix, from userid 1000)
	id ABDCA2AEC61F; Thu, 28 Oct 2010 22:54:56 +0800 (CST)
Message-Id: <20101028145456.ABDCA2AEC61F@sunpoet.net>
Date: Thu, 28 Oct 2010 22:54:56 +0800 (CST)
From: Sunpoet Po-Chuan Hsieh <sunpoet@FreeBSD.org>
Sender: Sunpoet Hsieh <sunpoet@sunpoet.net>
Reply-To: Sunpoet Po-Chuan Hsieh <sunpoet@FreeBSD.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [PATCH] Mk/bsd.port.mk: fix PLIST_DIRSTRY
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         151799
>Category:       ports
>Synopsis:       [PATCH] Mk/bsd.port.mk: fix PLIST_DIRSTRY
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pav
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Oct 28 15:00:22 UTC 2010
>Closed-Date:    Mon Nov 08 16:07:13 UTC 2010
>Last-Modified:  Mon Nov  8 16:10:04 UTC 2010
>Originator:     Sunpoet Po-Chuan Hsieh
>Release:        FreeBSD 8.1-STABLE amd64
>Organization:
SUNPOET.net
>Environment:
System: FreeBSD bonjour.sunpoet.net 8.1-STABLE FreeBSD 8.1-STABLE #0: Sat Oct 23 16:01:16 CST 2010 sunpoet@bonjour.sunpoet.net:/usr/obj/usr/src/sys/bonjour amd64
	
>Description:
PLIST_DIRSTRY is broken now. After a brief analysis, I found that dirrmtry
substitution (PLIST_REINPLACE_DIRRMTRY) was executed before PLIST_DIRSTRY
substitution. Therefore, @dirrmtry entries are left in WRKDIR/.PLIST.mktmp.
It breaks port installation.

The solution is to reorder the execution of PLIST_REINPLACE_DIRRMTRY and
PLIST_DIRSTRY substitution.

	
>How-To-Repeat:

Take ports/databases/pgsphere/Makefile,v 1.6 for example.

% cd /usr/ports/databases/pgsphere
% make install
...
===>   Registering installation for pgsphere-1.1.1_1
pkg_create: read_plist: unknown command '@dirrmtry share/postgresql/contrib' (package tools out of date?)
pkg_create: write_plist: unknown command type -1 (share/postgresql/contrib)
*** Error code 2

Stop in /usr/ports/databases/pgsphere.

% cat `make -V WRKDIR`/.PLIST.mktmp
lib/postgresql/pg_sphere.so
share/postgresql/contrib/pg_sphere.sql
@dirrmtry share/postgresql/contrib
@exec /sbin/ldconfig -m /usr/local/lib
@unexec /sbin/ldconfig -R

	
>Fix:

--- bsd.port.mk.patch begins here ---
Index: Mk/bsd.port.mk
===================================================================
RCS file: /home/ncvs/ports/Mk/bsd.port.mk,v
retrieving revision 1.651
diff -u -r1.651 bsd.port.mk
--- Mk/bsd.port.mk	25 Oct 2010 18:36:56 -0000	1.651
+++ Mk/bsd.port.mk	28 Oct 2010 14:23:37 -0000
@@ -5708,11 +5708,6 @@
 	@if [ -f ${PLIST} ]; then \
 		${SED} ${PLIST_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} ${PLIST} >> ${TMPPLIST}; \
 	fi
-.for reinplace in ${PLIST_REINPLACE}
-.if defined(PLIST_REINPLACE_${reinplace:U})
-	@${SED} -i "" -e '${PLIST_REINPLACE_${reinplace:U}}' ${TMPPLIST}
-.endif
-.endfor
  
 .for dir in ${PLIST_DIRS}
 	@${ECHO_CMD} ${dir} | ${SED} ${PLIST_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} -e 's,^,@dirrm ,' >> ${TMPPLIST}
@@ -5720,6 +5715,13 @@
 .for dir in ${PLIST_DIRSTRY}
 	@${ECHO_CMD} ${dir} | ${SED} ${PLIST_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} -e 's,^,@dirrmtry ,' >> ${TMPPLIST}
 .endfor
+
+.for reinplace in ${PLIST_REINPLACE}
+.if defined(PLIST_REINPLACE_${reinplace:U})
+	@${SED} -i "" -e '${PLIST_REINPLACE_${reinplace:U}}' ${TMPPLIST}
+.endif
+.endfor
+
 .if defined(USE_LINUX_PREFIX)
 .if defined(USE_LDCONFIG)
 	@${ECHO_CMD} "@exec ${LDCONFIG_CMD}" >> ${TMPPLIST}
--- bsd.port.mk.patch ends here ---
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->portmgr 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Thu Oct 28 15:00:31 UTC 2010 
Responsible-Changed-Why:  
bsd.port.mk is portmgr territory (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=151799 
Responsible-Changed-From-To: portmgr->pav 
Responsible-Changed-By: pav 
Responsible-Changed-When: Sat Nov 6 19:33:12 UTC 2010 
Responsible-Changed-Why:  
Grab 

http://www.freebsd.org/cgi/query-pr.cgi?pr=151799 
State-Changed-From-To: open->closed 
State-Changed-By: pav 
State-Changed-When: Mon Nov 8 16:05:57 UTC 2010 
State-Changed-Why:  
Committed, thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=151799 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/151799: commit references a PR
Date: Mon,  8 Nov 2010 16:07:08 +0000 (UTC)

 pav         2010-11-08 16:07:03 UTC
 
   FreeBSD ports repository
 
   Modified files:
     Mk                   bsd.port.mk 
   Log:
   - Fix PLIST_DIRSTRY: swap the substitutions to the proper order
   
   PR:             ports/151799
   Submitted by:   sunpoet
   
   Revision  Changes    Path
   1.654     +8 -6      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"
 
>Unformatted:
