diff options
author | rillig <rillig> | 2005-02-12 00:27:41 +0000 |
---|---|---|
committer | rillig <rillig> | 2005-02-12 00:27:41 +0000 |
commit | f3cfd0eca11168548aa7d7516c560f8cd5eb228c (patch) | |
tree | 0036a4fa01ea8f730a4433fbb10adc18542d3c5f /mk | |
parent | 4cba3f15db8531b9b2a428ee6bdc07e5460b010a (diff) | |
download | pkgsrc-f3cfd0eca11168548aa7d7516c560f8cd5eb228c.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.mk | 13 |
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}`"; \ |