pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/mk Moved checking if ${SHLOCK} exists into the shell c...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/a4ddb8dc3d04
branches:  trunk
changeset: 493741:a4ddb8dc3d04
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Fri May 13 22:22:44 2005 +0000

description:
Moved checking if ${SHLOCK} exists into the shell code fragment that
acquires the lock. This had to be done for the new tools framework and
because of the weird order of things in bsd.pkg.mk. Approved by jlam.

diffstat:

 mk/bsd.pkg.mk |  31 +++++++++++++++++--------------
 1 files changed, 17 insertions(+), 14 deletions(-)

diffs (59 lines):

diff -r 0750e7221613 -r a4ddb8dc3d04 mk/bsd.pkg.mk
--- a/mk/bsd.pkg.mk     Fri May 13 22:08:20 2005 +0000
+++ b/mk/bsd.pkg.mk     Fri May 13 22:22:44 2005 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: bsd.pkg.mk,v 1.1644 2005/05/13 21:13:01 jlam Exp $
+#      $NetBSD: bsd.pkg.mk,v 1.1645 2005/05/13 22:22:44 rillig Exp $
 #
 # This file is in the public domain.
 #
@@ -288,19 +288,6 @@
 PKG_FAIL_REASON+='ONLY/NOT_FOR_ARCHS/OPSYS are deprecated and must be replaced with ONLY/NOT_FOR_PLATFORM.'
 .endif
 
-.if (${PKGSRC_LOCKTYPE} == "sleep" || ${PKGSRC_LOCKTYPE} == "once")
-.  if !defined(OBJHOSTNAME)
-PKG_FAIL_REASON+='PKGSRC_LOCKTYPE needs OBJHOSTNAME defined.'
-.  elif empty(_USE_NEW_TOOLS:M[yY][eE][sS])
-.    if !exists(${SHLOCK})
-PKG_FAIL_REASON+='The ${SHLOCK} utility does not exist, and is necessary for locking.'
-PKG_FAIL_REASON+='Please "${MAKE} install" in ../../pkgtools/shlock.'
-.    endif
-.  else
-PKGSRC_USE_TOOLS+=     shlock
-.  endif
-.endif
-
 # Allow variables to be set on a per-OS basis
 OPSYSVARS+=    CFLAGS CXXFLAGS CPPFLAGS LDFLAGS LIBS
 .for _var_ in ${OPSYSVARS:O}
@@ -983,6 +970,11 @@
 # Extract
 .include "../../mk/bsd.pkg.extract.mk"
 
+# this must come before tools/bsd.tools.mk is included
+.if ${PKGSRC_LOCKTYPE} != "none"
+PKGSRC_USE_TOOLS+=     shlock
+.endif
+
 .if !empty(_USE_NEW_TOOLS:M[yY][eE][sS])
 .include "../../mk/tools/bsd.tools.mk"
 .else
@@ -1698,6 +1690,17 @@
 
 _ACQUIRE_LOCK=                                                         \
        ${_PKG_SILENT}${_PKG_DEBUG}                                     \
+       SHLOCK=${SHLOCK:Q};                                             \
+       if ${TEST} ! -f "$$SHLOCK" || ${TEST} ! -x "$$SHLOCK"; then     \
+               { ${ECHO} "The \"$$SHLOCK\" utility does not exist, and is necessary for locking."; \
+                 ${ECHO} "Please \""${MAKE:Q}" install\" in ../../pkgtools/shlock."; \
+               } 1>&2;                                                 \
+               ${FALSE};                                               \
+       fi;                                                             \
+       if ${TEST} x${OBJHOSTNAME:Ddefined} != x"defined"; then         \
+               ${ECHO} "PKGSRC_LOCKTYPE needs OBJHOSTNAME defined." 1>&2; \
+               ${FALSE};                                               \
+       fi;                                                             \
        ppid=`${PS} -p $$$$ -o ppid | ${AWK} 'NR == 2 { print $$1 }'`;  \
        if ${TEST} "$$ppid" = ""; then                                  \
                ${ECHO} "No parent process ID found.";                  \



Home | Main Index | Thread Index | Old Index