Bug 151414

Summary: Add 'work' when WRKDIRPREFIX is used.
Product: Ports & Packages Reporter: David E. O'Brien <obrien>
Component: Ports FrameworkAssignee: Port Management Team <portmgr>
Status: Closed Not Accepted    
Severity: Affects Only Me CC: bapt, linimon
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description David E. O'Brien freebsd_committer freebsd_triage 2010-10-12 21:30:04 UTC
	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.
Comment 1 swell.k 2010-10-13 06:07:07 UTC
"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
Comment 2 Philip M. Gollucci freebsd_committer freebsd_triage 2010-10-13 06:23:23 UTC
Responsible Changed
From-To: freebsd-ports-bugs->portmgr
Comment 3 andrew bliznak 2010-10-13 09:07:07 UTC
this can fail in case readonly nfs /usr/ports ...
Comment 4 David E. O'Brien freebsd_committer freebsd_triage 2010-10-13 19:34:47 UTC
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)
Comment 5 David E. O'Brien freebsd_committer freebsd_triage 2010-10-13 19:35:16 UTC
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)
Comment 6 Mark Linimon freebsd_committer freebsd_triage 2014-06-02 01:22:20 UTC
Infrastructure PR.
Comment 7 Baptiste Daroussin freebsd_committer freebsd_triage 2014-06-15 22:35:10 UTC
the reason why WRKDIRPREFIX can be overwritten is (among other reason) to be able to deal with readonly ports tree (in particular now we can build as a user to allow user to build without credential on the ports tree)