pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/mk Split out the "work" symlink creation into a separa...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/1eda2a18593a
branches:  trunk
changeset: 514340:1eda2a18593a
user:      jlam <jlam%pkgsrc.org@localhost>
date:      Sun Jun 11 02:14:45 2006 +0000

description:
Split out the "work" symlink creation into a separate step and add it
as a source for the "makedirs" target.  This ensures the symlink is
created regardless of whether ${WRKDIR} already exists or not.

diffstat:

 mk/bsd.pkg.mk |  24 +++++++++++++++---------
 1 files changed, 15 insertions(+), 9 deletions(-)

diffs (50 lines):

diff -r ff1cf4ca4153 -r 1eda2a18593a mk/bsd.pkg.mk
--- a/mk/bsd.pkg.mk     Sun Jun 11 02:00:06 2006 +0000
+++ b/mk/bsd.pkg.mk     Sun Jun 11 02:14:45 2006 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: bsd.pkg.mk,v 1.1849 2006/06/09 13:59:06 jlam Exp $
+#      $NetBSD: bsd.pkg.mk,v 1.1850 2006/06/11 02:14:45 jlam Exp $
 #
 # This file is in the public domain.
 #
@@ -69,7 +69,6 @@
 ############################################################################
 
 MKCRYPTO?=             YES     # build crypto packages by default
-CREATE_WRKDIR_SYMLINK?=        yes     # create a symlink to WRKOBJDIR
 
 ##### Variant spellings
 
@@ -855,18 +854,25 @@
 .  endif
 .endif
        ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${WRKDIR}
-.if defined(WRKOBJDIR)
+
+# Create a symlink from ${WRKDIR} to the package directory if
+# CREATE_WRKDIR_SYMLINK is "yes".
+#
+CREATE_WRKDIR_SYMLINK?=        yes
+
+.if defined(WRKOBJDIR) && !empty(CREATE_WRKDIR_SYMLINK:M[Yy][Ee][Ss])
+makedirs: ${.CURDIR}/${WRKDIR_BASENAME}
+ ${.CURDIR}/${WRKDIR_BASENAME}:
 .  if ${PKGSRC_LOCKTYPE} == "sleep" || ${PKGSRC_LOCKTYPE} == "once"
        ${_PKG_SILENT}${_PKG_DEBUG}                                     \
-       ${TEST} -f ${_LOCKFILE} || ${RM} -f ${WRKDIR_BASENAME}
+       ${TEST} -f ${_LOCKFILE} || ${RM} -f ${.TARGET}
 .  endif
-.  if !empty(CREATE_WRKDIR_SYMLINK:M[Yy][Ee][Ss])
        ${_PKG_SILENT}${_PKG_DEBUG}                                     \
-       if ${LN} -s ${WRKDIR} ${WRKDIR_BASENAME} 2>/dev/null; then      \
-               ${ECHO} "${WRKDIR_BASENAME} -> ${WRKDIR}";              \
+       if ${LN} -s ${WRKDIR} ${.TARGET} 2>/dev/null; then              \
+               ${ECHO} "${.TARGET:T} -> ${WRKDIR}";                    \
        fi
-.  endif
-.endif # WRKOBJDIR
+.endif
+
 
 # Configure
 



Home | Main Index | Thread Index | Old Index