summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorrillig <rillig@pkgsrc.org>2005-02-12 00:27:41 +0000
committerrillig <rillig@pkgsrc.org>2005-02-12 00:27:41 +0000
commit0fff1d5ac80aa521d40630279f09d7d63b38dc7e (patch)
tree0036a4fa01ea8f730a4433fbb10adc18542d3c5f /mk
parentba247f0c9104b8f3cdbbb182696baee49f139a5c (diff)
downloadpkgsrc-0fff1d5ac80aa521d40630279f09d7d63b38dc7e.tar.gz
Don't use the -nt operator for ${TEST}. It is not defined in POSIX, and
not provided by the Solaris 9 /bin/sh. Use the find(1) -newer expression instead, as it expresses exactly what we want, compared to the "ls -t" hack.
Diffstat (limited to 'mk')
-rw-r--r--mk/bsd.pkg.mk13
1 files changed, 8 insertions, 5 deletions
diff --git a/mk/bsd.pkg.mk b/mk/bsd.pkg.mk
index fce8d80186a..9e5cba1b093 100644
--- a/mk/bsd.pkg.mk
+++ b/mk/bsd.pkg.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.pkg.mk,v 1.1586 2005/02/11 17:00:07 tv Exp $
+# $NetBSD: bsd.pkg.mk,v 1.1587 2005/02/12 00:27:41 rillig Exp $
#
# This file is in the public domain.
#
@@ -1621,10 +1621,13 @@ _ACQUIRE_LOCK= \
${FALSE}; \
fi; \
while true; do \
- if ${TEST} -f /var/run/dmesg.boot -a -f ${LOCKFILE} -a \
- /var/run/dmesg.boot -nt ${LOCKFILE}; then \
- ${ECHO} "=> Removing stale ${LOCKFILE}"; \
- ${RM} ${LOCKFILE}; \
+ : "Remove lock files older than the last reboot"; \
+ if ${TEST} -f /var/run/dmesg.boot -a -f ${LOCKFILE}; then \
+ rebooted=`${FIND} /var/run/dmesg.boot -newer ${LOCKFILE}`; \
+ if ${TEST} x"$rebooted" != x; then \
+ ${ECHO} "=> Removing stale ${LOCKFILE}"; \
+ ${RM} ${LOCKFILE}; \
+ fi; \
fi; \
${SHLOCK} -f ${LOCKFILE} -p $$ppid && break; \
${ECHO} "=> Lock is held by pid `cat ${LOCKFILE}`"; \