From obrien@NUXI.org  Tue Oct 12 20:22:03 2010
Return-Path: <obrien@NUXI.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id AC57E1065695
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 12 Oct 2010 20:22:03 +0000 (UTC)
	(envelope-from obrien@NUXI.org)
Received: from dragon.nuxi.org (trang.nuxi.org [74.95.12.85])
	by mx1.freebsd.org (Postfix) with ESMTP id 881268FC2B
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 12 Oct 2010 20:22:03 +0000 (UTC)
Received: from dragon.nuxi.org (obrien@localhost [127.0.0.1])
	by dragon.nuxi.org (8.14.4/8.14.4) with ESMTP id o9CKM2PF025433
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 12 Oct 2010 13:22:02 -0700 (PDT)
	(envelope-from obrien@dragon.nuxi.org)
Received: (from obrien@localhost)
	by dragon.nuxi.org (8.14.4/8.14.4/Submit) id o9CKM2Of025432;
	Tue, 12 Oct 2010 13:22:02 -0700 (PDT)
	(envelope-from obrien)
Message-Id: <201010122022.o9CKM2Of025432@dragon.nuxi.org>
Date: Tue, 12 Oct 2010 13:22:02 -0700 (PDT)
From: "David O'Brien" <obrien@freebsd.org>
Reply-To: "David O'Brien" <obrien@freebsd.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: Add 'work' when WRKDIRPREFIX is used.
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         151414
>Category:       ports
>Synopsis:       Add 'work' when WRKDIRPREFIX is used.
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    portmgr
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Oct 12 20:30:04 UTC 2010
>Closed-Date:    
>Last-Modified:  Wed Oct 13 19:00:21 UTC 2010
>Originator:     David O'Brien
>Release:        FreeBSD 9.0-CURRENT i386
>Organization:
The FreeBSD Project
>Environment:
	FreeBSD
>Description:
	It can be a lot of typing to enter a ports's extracted directory
	if WRKDIRPREFIX is used.  In addition to the extra typing, one
	must remember the value of WRKDIRPREFIX - which could be set
	differently depending on where scratch space is available.

>How-To-Repeat:
	
>Fix:

Index: bsd.port.mk
===================================================================
RCS file: /home/ncvs/ports/Mk/bsd.port.mk,v
retrieving revision 1.649
diff -u -p -r1.649 bsd.port.mk
--- bsd.port.mk	29 Sep 2010 20:51:55 -0000	1.649
+++ bsd.port.mk	12 Oct 2010 20:11:50 -0000
@@ -3664,6 +3698,9 @@ do-extract:
 		${CHOWN} -R 0:0 ${WRKDIR}; \
 	fi
 .endif
+.if !empty(WRKDIRPREFIX)
+	@ln -s ${WRKDIRPREFIX}${.CURDIR}/work ${.CURDIR}
+.endif
 .endif
 
 # Patch
@@ -4589,6 +4631,9 @@ do-clean:
 			${ECHO_MSG} "===>   ${WRKDIR} not writable, skipping"; \
 		fi; \
 	fi
+.if !empty(WRKDIRPREFIX)
+	@[ -L ${.CURDIR}/work ] && rm -f ${.CURDIR}/work
+.endif
 .endif
 
 .if !target(clean)
>Release-Note:
>Audit-Trail:

From: Anonymous <swell.k@gmail.com>
To: David O'Brien <obrien@FreeBSD.org>
Cc: bug-followup@FreeBSD.org
Subject: Re: ports/151414: Add 'work' when WRKDIRPREFIX is used.
Date: Wed, 13 Oct 2010 09:07:07 +0400

 "David O'Brien" <obrien@FreeBSD.org> writes:
 
 > It can be a lot of typing to enter a ports's extracted directory
 > if WRKDIRPREFIX is used.  In addition to the extra typing, one
 > must remember the value of WRKDIRPREFIX - which could be set
 > differently depending on where scratch space is available.
 
 FYI, you can also use shell aliases
 
   $ alias cdw='cd $(make -V WRKDIR)'
   /usr/ports/editors/vim $ cdw
   /tmp/usr/ports/editors/vim/work $ cd -
   /usr/ports/editors/vim $
 
 or search through command history[1] for `cd $(make -V WRKDIR)' +
 return to origin directory via `cd' or `popd'. For example (zsh),
 
   $ setopt autopushd pushdminus
   $ cd category/port
   $ make patch
   $ cd $(make -V WRKSRC)
   $ ls
   $ cd path/to/blah
   $ ls
   $ editor sourcefile.c
   $ cd -
   $ diff path/to/blah/sourcefile.c{.bak,} >~-2/files/patch-sourcefile.c
   $ cd -2
   $ make
 
 [1] either history-incremental-search-backward
     or     history-search-backward
Responsible-Changed-From-To: freebsd-ports-bugs->portmgr 
Responsible-Changed-By: pgollucci 
Responsible-Changed-When: Wed Oct 13 05:23:23 UTC 2010 
Responsible-Changed-Why:  


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

From: Andrew Bliznak <andriko.b@gmail.com>
To: bug-followup@FreeBSD.org, obrien@freebsd.org
Cc:  
Subject: Re: ports/151414: Add 'work' when WRKDIRPREFIX is used.
Date: Wed, 13 Oct 2010 11:07:07 +0300

 this can fail in case readonly nfs /usr/ports ...

From: "David O'Brien" <obrien@FreeBSD.org>
To: Andrew Bliznak <andriko.b@gmail.com>
Cc: bug-followup@FreeBSD.org
Subject: Re: ports/151414: Add 'work' when WRKDIRPREFIX is used.
Date: Wed, 13 Oct 2010 11:35:16 -0700

 On Wed, Oct 13, 2010 at 11:07:07AM +0300, Andrew Bliznak wrote:
 > this can fail in case readonly nfs /usr/ports ...
 
 Good point - that's not my environment so I didn't consider that.
 
 -- 
 -- David  (obrien@FreeBSD.org)

From: "David O'Brien" <obrien@FreeBSD.org>
To: Anonymous <swell.k@gmail.com>
Cc: bug-followup@FreeBSD.org
Subject: Re: ports/151414: Add 'work' when WRKDIRPREFIX is used.
Date: Wed, 13 Oct 2010 11:34:47 -0700

 On Wed, Oct 13, 2010 at 09:07:07AM +0400, Anonymous wrote:
 > "David O'Brien" <obrien@FreeBSD.org> writes:
 > 
 > > It can be a lot of typing to enter a ports's extracted directory
 > > if WRKDIRPREFIX is used.  In addition to the extra typing, one
 > > must remember the value of WRKDIRPREFIX - which could be set
 > > differently depending on where scratch space is available.
 > 
 > FYI, you can also use shell aliases
 [..several line aliases eludede..]
 
 One should not have to thru this much trouble.
 
 Please see the 'make objlink' within /usr/src.
 
 -- 
 -- David  (obrien@FreeBSD.org)
>Unformatted:
