Bug 179047 - [PATCH] net/nss_ldap: dpn't override ${PREFIX}/etc/nss_ldap.conf
Summary: [PATCH] net/nss_ldap: dpn't override ${PREFIX}/etc/nss_ldap.conf
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: Andrej Zverev
Depends on:
Reported: 2013-05-28 12:20 UTC by Anton Yuzhaninov
Modified: 2013-06-15 11:50 UTC (History)
1 user (show)

See Also:

nss_ldap-1.265_7.patch (596 bytes, patch)
2013-05-28 12:20 UTC, Anton Yuzhaninov
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Anton Yuzhaninov 2013-05-28 12:20:00 UTC
After upgrade net/nss_ldap my local /usr/local/etc/nss_ldap.conf was
overridden by nss_ldap.conf.sample

Port Makefile has
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

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

Generated with FreeBSD Port Tools 0.99_7 (mode: change, diff: ports)

Fix: Just follow the Handbook:
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.
Comment 1 Edwin Groothuis freebsd_committer 2013-05-28 12:20:08 UTC
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:

Edwin Groothuis via the GNATS Auto Assign Tool
Comment 2 Edwin Groothuis freebsd_committer 2013-05-28 12:20:09 UTC
State Changed
From-To: open->feedback

Awaiting maintainers feedback (via the GNATS Auto Assign Tool)
Comment 3 Andrej Zverev freebsd_committer 2013-06-14 17:50:10 UTC
Responsible Changed
From-To: freebsd-ports-bugs->az

I'll take it.
Comment 4 dfilter service freebsd_committer 2013-06-15 11:42:56 UTC
Author: az
Date: Sat Jun 15 10:42:49 2013
New Revision: 320982
URL: http://svnweb.freebsd.org/changeset/ports/320982

  - Prevent situation which leads to overriding configuration file on reinstall.
  PR:		ports/179047
  Submitted by:	Anton Yuzhaninov <ayuzhaninov@openstat.ru>
  Approved by:	maintainer (timeout)

  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
-.if !exists(${PREFIX}/etc/nss_ldap.conf)
-	${CP} -p ${PREFIX}/etc/nss_ldap.conf.sample ${PREFIX}/etc/nss_ldap.conf
+	@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)
svn-ports-all@freebsd.org mailing list
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 5 Andrej Zverev freebsd_committer 2013-06-15 11:43:23 UTC
State Changed
From-To: feedback->closed

Committed. Thanks!