From citrin@example.ru  Tue May 28 11:13:24 2013
Return-Path: <citrin@example.ru>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1])
	by hub.freebsd.org (Postfix) with ESMTP id A2D61E21
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 28 May 2013 11:13:24 +0000 (UTC)
	(envelope-from citrin@example.ru)
Received: from mail.openstat.ru (mail.openstat.ru [193.169.234.252])
	by mx1.freebsd.org (Postfix) with ESMTP id 5BAFEEAB
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 28 May 2013 11:13:23 +0000 (UTC)
Received: from monitoring.int.vega.ru ([10.25.1.153])
	by mail.openstat.ru with esmtps (TLSv1:DHE-RSA-AES256-SHA:256)
	(Exim 4.80.1 (FreeBSD))
	(envelope-from <citrin@example.ru>)
	id 1UhHqD-000ISg-2R; Tue, 28 May 2013 15:13:21 +0400
Received: from monitoring.int.vega.ru (monitoring.int.vega.ru [10.25.1.153])
	by monitoring.int.vega.ru (8.14.5/8.14.5) with ESMTP id r4SBDKFO081609;
	Tue, 28 May 2013 11:13:20 GMT
	(envelope-from citrin@example.ru)
Received: (from ayuzhaninov@localhost)
	by monitoring.int.vega.ru (8.14.5/8.14.5/Submit) id r4SBDK2T081608;
	Tue, 28 May 2013 11:13:20 GMT
	(envelope-from citrin@example.ru)
Message-Id: <201305281113.r4SBDK2T081608@monitoring.int.vega.ru>
Date: Tue, 28 May 2013 11:13:20 GMT
From: Anton Yuzhaninov <ayuzhaninov@openstat.ru>
To: FreeBSD-gnats-submit@freebsd.org
Cc: mikeg@bsd-box.net
Subject: [PATCH] net/nss_ldap: dpn't override ${PREFIX}/etc/nss_ldap.conf
X-Send-Pr-Version: 3.113
X-GNATS-Notify: mikeg@bsd-box.net

>Number:         179047
>Category:       ports
>Synopsis:       [PATCH] net/nss_ldap: dpn't override ${PREFIX}/etc/nss_ldap.conf
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    az
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue May 28 11:20:00 UTC 2013
>Closed-Date:    Sat Jun 15 10:43:25 UTC 2013
>Last-Modified:  Sat Jun 15 10:50:00 UTC 2013
>Originator:     Anton Yuzhaninov
>Release:        FreeBSD 8.3-PRERELEASE-20120415 amd64
>Organization:
>Environment:
System: FreeBSD monitoring.int.vega.ru 8.3-PRERELEASE-20120415 FreeBSD 8.3-PRERELEASE-20120415 #0: Sun Apr 15 00:27:26 UTC 2012
>Description:
After upgrade net/nss_ldap my local /usr/local/etc/nss_ldap.conf was
overridden by nss_ldap.conf.sample

Port Makefile has
!exists(${PREFIX}/etc/nss_ldap.conf)
But this don't work, and should not work as need:
variable ${PREFIX} expanded after !exists evaluted and cached.

If you run make -d A install you will see:
....
Searching for /etc/nss_ldap.conf...Looking for "/etc/nss_ldap.conf"...failed. Returning NULL
....
Global:PREFIX = ${LOCALBASE}
....

Port maintainer (mikeg@bsd-box.net) is cc'd.

Generated with FreeBSD Port Tools 0.99_7 (mode: change, diff: ports)
>How-To-Repeat:
Edit /usr/local/etc/nss_ldap.conf
update/install net/nss_ldap
Local changes in /usr/local/etc/nss_ldap.conf will be lost.
>Fix:
Just follow the Handbook:
http://www.freebsd.org/doc/en/books/porters-handbook/plist-config.html

--- nss_ldap-1.265_7.patch begins here ---
diff -ruN /usr/ports//net/nss_ldap/Makefile ./Makefile
--- /usr/ports//net/nss_ldap/Makefile	2013-05-17 13:47:11.000000000 +0000
+++ ./Makefile	2013-05-28 10:52:30.000000000 +0000
@@ -75,9 +75,9 @@
 	${INSTALL_MAN} ${WRKSRC}/${MAN5} ${MAN5PREFIX}/man/man5
 
 post-install:
-.if !exists(${PREFIX}/etc/nss_ldap.conf)
-	${CP} -p ${PREFIX}/etc/nss_ldap.conf.sample ${PREFIX}/etc/nss_ldap.conf
-.endif
+	@if [ ! -f ${PREFIX}/etc/nss_ldap.conf ]; then \
+		${CP} -pv ${PREFIX}/etc/nss_ldap.conf.sample ${PREFIX}/etc/nss_ldap.conf ; \
+	fi
 .if !defined(PACKAGE_BUILDING)
 	@${CAT} ${PKGMESSAGE}
 .endif
--- nss_ldap-1.265_7.patch ends here ---

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: edwin 
State-Changed-When: Tue May 28 11:20:09 UTC 2013 
State-Changed-Why:  
Awaiting maintainers feedback (via the GNATS Auto Assign Tool) 

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

From: Edwin Groothuis <edwin@FreeBSD.org>
To: mikeg@bsd-box.net
Cc: bug-followup@FreeBSD.org
Subject: Re: ports/179047: [PATCH] net/nss_ldap: dpn't override ${PREFIX}/etc/nss_ldap.conf
Date: Tue, 28 May 2013 11:20:08 UT

 Maintainer of net/nss_ldap,
 
 Please note that PR ports/179047 has just been submitted.
 
 If it contains a patch for an upgrade, an enhancement or a bug fix
 you agree on, reply to this email stating that you approve the patch
 and a committer will take care of it.
 
 The full text of the PR can be found at:
     http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/179047
 
 -- 
 Edwin Groothuis via the GNATS Auto Assign Tool
 edwin@FreeBSD.org
Responsible-Changed-From-To: freebsd-ports-bugs->az 
Responsible-Changed-By: az 
Responsible-Changed-When: Fri Jun 14 16:50:10 UTC 2013 
Responsible-Changed-Why:  
I'll take it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=179047 
State-Changed-From-To: feedback->closed 
State-Changed-By: az 
State-Changed-When: Sat Jun 15 10:43:23 UTC 2013 
State-Changed-Why:  
Committed. Thanks! 

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

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/179047: commit references a PR
Date: Sat, 15 Jun 2013 10:42:56 +0000 (UTC)

 Author: az
 Date: Sat Jun 15 10:42:49 2013
 New Revision: 320982
 URL: http://svnweb.freebsd.org/changeset/ports/320982
 
 Log:
   - Prevent situation which leads to overriding configuration file on reinstall.
   
   PR:		ports/179047
   Submitted by:	Anton Yuzhaninov <ayuzhaninov@openstat.ru>
   Approved by:	maintainer (timeout)
 
 Modified:
   head/net/nss_ldap/Makefile   (contents, props changed)
 
 Modified: head/net/nss_ldap/Makefile
 ==============================================================================
 --- head/net/nss_ldap/Makefile	Sat Jun 15 09:41:38 2013	(r320981)
 +++ head/net/nss_ldap/Makefile	Sat Jun 15 10:42:49 2013	(r320982)
 @@ -75,9 +75,9 @@ do-install:
  	${INSTALL_MAN} ${WRKSRC}/${MAN5} ${MAN5PREFIX}/man/man5
  
  post-install:
 -.if !exists(${PREFIX}/etc/nss_ldap.conf)
 -	${CP} -p ${PREFIX}/etc/nss_ldap.conf.sample ${PREFIX}/etc/nss_ldap.conf
 -.endif
 +	@if [ ! -f ${PREFIX}/etc/nss_ldap.conf ]; then \
 +		${CP} -pv ${PREFIX}/etc/nss_ldap.conf.sample ${PREFIX}/etc/nss_ldap.conf ; \
 +	fi
  .if !defined(PACKAGE_BUILDING)
  	@${CAT} ${PKGMESSAGE}
  .endif
 _______________________________________________
 svn-ports-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-ports-all
 To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
 
>Unformatted:
