From rafan@svm.csie.ntu.edu.tw  Thu Oct 26 18:58:40 2006
Return-Path: <rafan@svm.csie.ntu.edu.tw>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 5CB7E16A412;
	Thu, 26 Oct 2006 18:58:40 +0000 (UTC)
	(envelope-from rafan@svm.csie.ntu.edu.tw)
Received: from svm.csie.ntu.edu.tw (svm.csie.ntu.edu.tw [140.112.90.75])
	by mx1.FreeBSD.org (Postfix) with ESMTP id E10D943D5C;
	Thu, 26 Oct 2006 18:58:39 +0000 (GMT)
	(envelope-from rafan@svm.csie.ntu.edu.tw)
Received: from svm.csie.ntu.edu.tw (localhost [127.0.0.1])
	by svm.csie.ntu.edu.tw (8.13.8/8.13.8) with ESMTP id k9QIwdA3079900;
	Fri, 27 Oct 2006 02:58:39 +0800 (CST)
	(envelope-from rafan@svm.csie.ntu.edu.tw)
Received: (from rafan@localhost)
	by svm.csie.ntu.edu.tw (8.13.8/8.13.8/Submit) id k9QIwcMJ074538;
	Fri, 27 Oct 2006 02:58:38 +0800 (CST)
	(envelope-from rafan)
Message-Id: <200610261858.k9QIwcMJ074538@svm.csie.ntu.edu.tw>
Date: Fri, 27 Oct 2006 02:58:38 +0800 (CST)
From: Rong-En Fan <rafan@freebsd.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc: ale@freebsd.org
Subject: [PATCH] sysutils/portconf: auto detect real path of /usr/ports
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         104838
>Category:       ports
>Synopsis:       [PATCH] ports-mgmt/portconf: auto detect real path of /usr/ports
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    ale
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Oct 26 19:00:36 GMT 2006
>Closed-Date:    Fri Jun 22 10:41:22 GMT 2007
>Last-Modified:  Fri Jun 22 10:50:03 GMT 2007
>Originator:     Rong-En Fan
>Release:        FreeBSD 6.2-PRERELEASE amd64
>Organization:
NTU CSIE
>Environment:
>Description:
Make make.conf auto detect where the real path of /usr/ports is.
If your /usr/ports is a symlink, portconf can still work.

Port maintainer (ale@FreeBSD.org) is cc'd.

Generated with FreeBSD Port Tools 0.77
>How-To-Repeat:
>Fix:

--- portconf-1.2_1.patch begins here ---
Index: Makefile
===================================================================
RCS file: /big/freebsd-cvsup/ncvs/ports/sysutils/portconf/Makefile,v
retrieving revision 1.3
diff -u -u -r1.3 Makefile
--- Makefile	6 Sep 2006 12:50:31 -0000	1.3
+++ Makefile	26 Oct 2006 18:57:12 -0000
@@ -9,6 +9,7 @@
 
 PORTNAME=	portconf
 PORTVERSION=	1.2
+PORTREVISION=	1
 CATEGORIES=	sysutils
 MASTER_SITES=	# none
 DISTFILES=	# none
Index: pkg-install
===================================================================
RCS file: /big/freebsd-cvsup/ncvs/ports/sysutils/portconf/pkg-install,v
retrieving revision 1.1
diff -u -u -r1.1 pkg-install
--- pkg-install	9 Jun 2006 08:17:35 -0000	1.1
+++ pkg-install	26 Oct 2006 18:57:12 -0000
@@ -7,7 +7,12 @@
 cat >> ${MAKE_CONF} << EOF
 # Begin portconf settings
 # Do not touch these lines
-.if !empty(.CURDIR:M/usr/ports*) && exists(${PKG_PREFIX}/libexec/portconf)
+.if !empty(\${PORTSDIR})
+_PORTSDIR!=	/bin/realpath \${PORTSDIR}
+.else
+_PORTSDIR!=	/bin/realpath /usr/ports
+.endif
+.if \${.CURDIR:M\${_PORTSDIR}*} != "" && exists(${PKG_PREFIX}/libexec/portconf)
 _PORTCONF!=${PKG_PREFIX}/libexec/portconf
 .for i in \${_PORTCONF:S/|/ /g}
 \${i:S/%/ /g}
--- portconf-1.2_1.patch ends here ---

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->ale 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Thu Oct 26 19:00:50 UTC 2006 
Responsible-Changed-Why:  
Over to maintainer 

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

From: Rong-En Fan <rafan@freebsd.org>
To: bugs-followup@freebsd.org
Cc: ale@freebsd.org
Subject: Re: ports/104838: [PATCH] sysutils/portconf: auto detect real path of /usr/ports
Date: Wed, 7 Mar 2007 15:12:31 +0800

 --zx4FCpZtqtKETZ7O
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 
 Since _PORTSDIR will be invoked whenever make is invoked,
 I measured the time requirement for buildworld against RELENG_6
 src/ on P4 3.4G i386 box running 6.2-RELEASE.
 
 before / after: 49m24.906s / 52m17.299s
 
 If this is not acceptable, call realpath when at installation
 stage and add a message in pkg-message.
 
 Regards,
 Rong-En Fan
 
 --zx4FCpZtqtKETZ7O
 Content-Type: application/pgp-signature
 Content-Disposition: inline
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.2 (FreeBSD)
 
 iD8DBQFF7mXf144QkYb9jGgRAkGKAKCP5473lf1WZHnUZjqd7PHDwWPNdACglsHR
 6loYneET3/FBmaQ4dFnyi8c=
 =c5BQ
 -----END PGP SIGNATURE-----
 
 --zx4FCpZtqtKETZ7O--

From: Rong-En Fan <rafan@FreeBSD.org>
To: FreeBSD-gnats-submit@FreeBSD.org, freebsd-ports-bugs@FreeBSD.org
Cc: Rong-En Fan <rafan@FreeBSD.org>, ale@FreeBSD.org
Subject: Re: ports/104838: [PATCH] sysutils/portconf: auto detect real path
	of /usr/ports
Date: Thu, 26 Apr 2007 17:58:54 +0800

 I found that ${VAR} != "" does not work as I thought.
 It should be replaced by empty(). I updated the patch at
 
 http://people.freebsd.org/~rafan/portconf.diff
 
 Rong-En Fan
State-Changed-From-To: open->closed 
State-Changed-By: rafan 
State-Changed-When: Fri Jun 22 10:41:21 UTC 2007 
State-Changed-Why:  
Committed with different approach. 

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

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/104838: commit references a PR
Date: Fri, 22 Jun 2007 10:41:07 +0000 (UTC)

 rafan       2007-06-22 10:41:01 UTC
 
   FreeBSD ports repository
 
   Modified files:
     ports-mgmt/portconf  pkg-install 
   Log:
   - Make portconf work when /usr/ports is a symlink.  When the link is changed,
     you have to reinstall portconf to get make.conf right.
   
   As this does not affect most people, PORTREVISION is not bumped.
   
   The patch in the PR does not work: we can not use variable in substitution.
   So, the only way to do is to detect the real path of /usr/ports at
   installation time.
   
   PR:             ports/104838
   Submitted by:   rafan
   Approved by:    maintainer timeout (8 months)
   
   Revision  Changes    Path
   1.2       +2 -1      ports/ports-mgmt/portconf/pkg-install
 _______________________________________________
 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:
