From dan@dual.ms.mff.cuni.cz  Sun Aug 30 18:36:43 2009
Return-Path: <dan@dual.ms.mff.cuni.cz>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id F266A1065692
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 30 Aug 2009 18:36:43 +0000 (UTC)
	(envelope-from dan@dual.ms.mff.cuni.cz)
Received: from dual.ms.mff.cuni.cz (www.freebsd.cz [IPv6:2001:718:1e03:801::6])
	by mx1.freebsd.org (Postfix) with ESMTP id 8578B8FC0A
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 30 Aug 2009 18:36:43 +0000 (UTC)
Received: (from root@localhost)
	by kulesh.obluda.cz (8.14.3/8.14.3/Submit) id n7UHkeER001238;
	Sun, 30 Aug 2009 19:46:40 +0200 (CEST)
	(envelope-from dan)
Message-Id: <200908301746.n7UHkeER001238@kulesh.obluda.cz>
Date: Sun, 30 Aug 2009 19:46:40 +0200 (CEST)
From: Dan Lukes <dan@obluda.cz>
Reply-To: Dan Lukes <dan@obluda.cz>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: net/freeradius2 can't install from package when /usr/ports mounted RO
X-Send-Pr-Version: 3.113
X-GNATS-Notify: david@wood2.org.uk

>Number:         138355
>Category:       ports
>Synopsis:       net/freeradius2 can't install from package when /usr/ports mounted RO
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sun Aug 30 18:40:02 UTC 2009
>Closed-Date:    Fri Sep 18 11:18:21 UTC 2009
>Last-Modified:  Fri Sep 18 11:20:01 UTC 2009
>Originator:     Dan Lukes
>Release:        FreeBSD
>Organization:
Obludarium
>Environment:
System: FreeBSD 7.2-STABLE
but exact FreeBSD version is not relevant

net/freeradius2/files/pkg-install.in,v 1.4 2009/04/22 16:28:18

>Description:
	net/freeradius2 can't be instaled from package when /usr/ports tree
present && net/freeradius2/work/radiusd.conf exist && /usr/ports tree mouted
read-only

	It's not artifical scenario. Imagine central distribution point where all
required ports are compiled with apropriate options and packages are created 

	the /usr/ports tree from repository is read-only mounted 
to other machine. Here the packages are installed from /usr/ports/packages/All
	

>How-To-Repeat:
   Prolog:
	create package of net/freeradius2 port
	working directory of the port MUST NOT be deleted
         (e.g. /usr/ports/net/freeradius2/work/radiusd.conf still exist)
	deinstall net/freeradius2
	
   Now you:
	mount /usr/ports tree as read-only
	install net/freeradis2 from package

	the installation will fail because install script will fail because the
/usr/ports/net/freeradius2/work/radiusd.conf exists, but not writable

>Fix:

	Patch writable files only:

--- patch-FREERADIUS2 begins here ---
--- net/freeradius2/files/pkg-install.in.orig	2009-08-30 19:22:27.000000000 +0200
+++ net/freeradius2/files/pkg-install.in	2009-08-30 19:23:07.000000000 +0200
@@ -104,7 +104,7 @@
         # Fix the user and group in raddb/radiusd.conf
 	echo "===> Setting user and group in radiusd.conf"
 	for file in ${radius_raddb_work}/radiusd.conf ${radius_raddb}/radiusd.conf; do
-	    if [ -f ${file} ]; then
+	    if [ -w ${file} ]; then
 		if ! sed -Ee "s/^[[:space:]#]*(user[[:space:]]*=[[:space:]]*).*$/\1${radius_user}/" \
 		    -e "s/^[[:space:]#]*(group[[:space:]]*=[[:space:]]*).*$/\1${radius_group}/" \
 		    -i .orig ${file}; then
--- patch-FREERADIUS2 ends here ---
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: edwin 
State-Changed-When: Sun Aug 30 18:40:15 UTC 2009 
State-Changed-Why:  
Awaiting maintainers feedback (via the GNATS Auto Assign Tool) 

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

From: Edwin Groothuis <edwin@FreeBSD.org>
To: david@wood2.org.uk
Cc: bug-followup@FreeBSD.org
Subject: Re: ports/138355: net/freeradius2 can't install from package when /usr/ports mounted RO
Date: Sun, 30 Aug 2009 18:40:14 UT

 Maintainer of net/freeradius2,
 
 Please note that PR ports/138355 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/138355
 
 -- 
 Edwin Groothuis via the GNATS Auto Assign Tool
 edwin@FreeBSD.org

From: David Wood <david@wood2.org.uk>
To: bug-followup@FreeBSD.org, dan@obluda.cz
Cc:  
Subject: Re: ports/138355: net/freeradius2 can't install from package when /usr/ports mounted RO
Date: Wed, 9 Sep 2009 20:39:27 +0100

 Patch approved. Thank you.
 
 
 
 David
 (maintainer net/freeradius2)
 -- 
 David Wood
 david@wood2.org.uk
State-Changed-From-To: feedback->closed 
State-Changed-By: pav 
State-Changed-When: Fri Sep 18 11:11:59 UTC 2009 
State-Changed-Why:  
Committed, thanks! 

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

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/138355: commit references a PR
Date: Fri, 18 Sep 2009 11:18:19 +0000 (UTC)

 pav         2009-09-18 11:18:09 UTC
 
   FreeBSD ports repository
 
   Modified files:
     net/freeradius2/files pkg-install.in 
   Log:
   - Allow the installation to proceed with read-only workdir
   
   PR:             ports/138355
   Submitted by:   Dan Lukes <dan@obluda.cz>
   Approved by:    David Wood <david@wood2.org.uk> (maintainer)
   Feature safe:   yes
   
   Revision  Changes    Path
   1.5       +2 -2      ports/net/freeradius2/files/pkg-install.in
 _______________________________________________
 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:
