summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mk/bsd.pkg.mk31
1 files changed, 17 insertions, 14 deletions
diff --git a/mk/bsd.pkg.mk b/mk/bsd.pkg.mk
index 93d762d211b..abfb4f7a3a0 100644
--- a/mk/bsd.pkg.mk
+++ b/mk/bsd.pkg.mk
@@ -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+='PATCH_SITE_SUBDIR is deprecated and must be replaced with PATC
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 @@ PKGSRC_USE_TOOLS+= mail
# 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 @@ LOCKFILE= ${WRKDIR}/.lockfile
_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."; \