From owner-freebsd-ports Fri Jul 21 17:59:38 2000 Delivered-To: freebsd-ports@freebsd.org Received: from granger.mail.mindspring.net (granger.mail.mindspring.net [207.69.200.148]) by hub.freebsd.org (Postfix) with ESMTP id 9982A37C612; Fri, 21 Jul 2000 17:36:17 -0700 (PDT) (envelope-from asami@cs.berkeley.edu) Received: from silvia.hip.berkeley.edu (sji-ca14-12.ix.netcom.com [205.186.215.12]) by granger.mail.mindspring.net (8.9.3/8.8.5) with ESMTP id UAA00135; Fri, 21 Jul 2000 20:36:14 -0400 (EDT) Received: (from asami@localhost) by silvia.hip.berkeley.edu (8.9.3/8.6.9) id RAA71941; Fri, 21 Jul 2000 17:36:13 -0700 (PDT) To: Maxim Sobolev Cc: ports@FreeBSD.org Subject: Re: bsd.port.mk feature requiest [patch] References: <3972E25C.7CDA3E2C@FreeBSD.org> From: asami@FreeBSD.org (Satoshi - Ports Wraith - Asami) Date: 21 Jul 2000 17:36:12 -0700 In-Reply-To: Maxim Sobolev's message of "Mon, 17 Jul 2000 13:39:24 +0300" Message-ID: Lines: 79 X-Mailer: Gnus v5.7/Emacs 20.7 Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org * From: Maxim Sobolev What do people think about this one? Satoshi ------- Hi Porters! After some amount of extensive porting I found that WRKDIRPREFIX is quite useful options which helps to keep crap generated bu the port builds away from /usr/ports, but unfortunately it turns into a problem when you have to not only build ports but make some debugging/upgrading/fixing. Without this option you could use convenient trial/error/fix scheme, but when WRKDIRPREFIX is defined the port and its ${WRKDIR} could be too far away from each other, which makes this process a too painful. Therefore I came with the following patch, which I believe combines best from the two cases (i.e. WRKDIRPREFIX and !WRKDIRPREFIX) simply by installing symlink from ${WRKDIR} to ${.CURRDIR}/work, so with this option enabled you can have WRKDIRPREFIX defined to keep crap in one place, while still able to do " cd myport ; make [bah error!] cd work/myport ; vi configure; diff -du configure.orig configure > ../../patches/patch-aa ; cd ../../ ; make" ;). -Maxim --------------44CEE1A18DF2B26B959D66B1 Content-Type: text/plain; charset=koi8-r; name="symlink.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="symlink.patch" --- bsd.port.mk 2000/07/17 08:53:31 1.1 +++ bsd.port.mk 2000/07/17 09:11:06 @@ -225,6 +225,9 @@ # unpacks to. (Default: ${WRKDIR}/${DISTNAME} unless # NO_WRKSUBDIR is set, in which case simply ${WRKDIR}). # NO_WRKSUBDIR - Assume port unpacks directly into ${WRKDIR}. +# CREATE_WRKDIR_SYMLINK - Create symlink from ${WRKDIR} to ${.CURDIR}/work. Very usefill +# when you use ${WRKDIRPREFIX} but still want ${WRKDIR} +# to be quickly accesible for debugging purposes. # PATCHDIR - A directory containing any additional patches you made # to port this software to FreeBSD (default: # ${MASTERDIR}/patches) @@ -1591,6 +1594,15 @@ do-extract: @${RM} -rf ${WRKDIR} @${MKDIR} ${WRKDIR} +.if defined(CREATE_WRKDIR_SYMLINK) + @if [ x"${.CURDIR}/work" != x"${WRKDIR}" ]; then \ + if [ -w ${.CURDIR} ]; then \ + ${LN} -sf ${WRKDIR} ${.CURDIR}/work; \ + else \ + ${ECHO_MSG} "===> ${CURDIR} not writable, link not created"; \ + fi; \ + fi +.endif @for file in ${EXTRACT_ONLY}; do \ if ! (cd ${WRKDIR} && ${EXTRACT_CMD} ${EXTRACT_BEFORE_ARGS} ${_DISTDIR}/$$file ${EXTRACT_AFTER_ARGS});\ then \ @@ -2065,6 +2077,15 @@ ${ECHO_MSG} "===> ${WRKDIR} not writable, skipping"; \ fi; \ fi +.if defined(CREATE_WRKDIR_SYMLINK) + @if [ -L ${.CURDIR}/work ]; then \ + if [ -w ${.CURDIR} ]; then \ + ${RM} -f ${.CURDIR}/work; \ + else \ + ${ECHO_MSG} "===> ${CURDIR} not writable, skipping"; \ + fi; \ + fi +.endif .endif .if !target(clean) --------------44CEE1A18DF2B26B959D66B1-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message