Date: Mon, 17 Jul 2000 13:39:24 +0300 From: Maxim Sobolev <sobomax@FreeBSD.org> To: ports@FreeBSD.org Cc: asami@FreeBSD.org Subject: bsd.port.mk feature requiest [patch] Message-ID: <3972E25C.7CDA3E2C@FreeBSD.org>
next in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format. --------------44CEE1A18DF2B26B959D66B1 Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 7bit 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3972E25C.7CDA3E2C>