Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 19 Nov 2001 13:06:34 -0800 (PST)
From:      "Crist J. Clark" <cristjc@earthlink.net>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   ports/32114: WRKDIRs should be moved to a central location
Message-ID:  <200111192106.fAJL6Yh00849@blossom.cjclark.org>

next in thread | raw e-mail | index | archive | help

>Number:         32114
>Category:       ports
>Synopsis:       WRKDIRs should be moved to a central location
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Nov 19 13:10:00 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     Crist J. Clark
>Release:        FreeBSD 4.4-STABLE i386
>Organization:
>Environment:
System: FreeBSD blossom.cjclark.org 4.4-STABLE FreeBSD 4.4-STABLE #0: Wed Nov 7 14:50:28 PST 2001 cjc@blossom.cjclark.org:/usr/obj/export/stable/src/sys/BLOSSOM i386


	Ports system as of above date.

>Description:
	Presently, the ports Makefiles will by default put the WRKDIR
in ${.CURDIR}/work. For a typical installation this means that a build
in /usr/ports/<category>/<portname> will put the work files in,

  /usr/ports/<category>/<portname>/work

	At first glance, this seems to make perfect sense. However,
this design has drawbacks. If one wants to make sure there are no
stale work directories around, he can either,

  # cd /usr/ports && make -DNOCLEANDEPENDS 

Which takes a _long_ time, or

  # find /usr/ports -type d -name work -exec rm -rf {} \;

Which is somewhat faster, but a bit dangerous.

	I would claim that it is better to put all WRKDIRs in a
central location. For example, /usr/ports/work. This has the advantage
that when one wishes to clean out old work directories, a single,

  # rm -rf /usr/ports/work/*

Will do the trick. This also brings work directories into line with
how distfiles are stored. After all, distfiles are all by default
placed in /usr/ports/distfiles, they aren't kept in
${.CURDIR}/distfiles even though that would work fine. The only
drawback I can see is that it might be marginally harder for the
novice ports user to find the work directory. However, anyone who
plans to go hacking into the build directory should probably have the
skills to find it. The vast majority of ports users will never know
the difference.

>How-To-Repeat:
	N/A

>Fix:
	For anyone wishing to do this for themselves, a simple,

  WRKDIRPREFIX?=	/usr/ports/work

In /etc/make.conf will do it. However, the reason for the PR is that I
believe somemthing like this would be a better default than the current
design. Just inserting the line above into Mk/bsd.ports.mk would do
it. There are also fancier ways to go so that the build takes place
in,

  /usr/ports/work/<category>/<portname>

But they may break existing localizations whereas changing the default
WRKDIRPREFIX from null to something else should not cause any
back-portablility issues.
>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200111192106.fAJL6Yh00849>