summaryrefslogtreecommitdiff
path: root/mk/wrapper/logic
diff options
context:
space:
mode:
authorrillig <rillig@pkgsrc.org>2006-10-21 11:42:25 +0000
committerrillig <rillig@pkgsrc.org>2006-10-21 11:42:25 +0000
commit837c83c041c1ea4c97566a983efd147b47c78aca (patch)
tree183e33b5d1ed0cf0f5da1d12ccb5299bc9043bd4 /mk/wrapper/logic
parentd803961ee92a4e42af3cebf4981293e274c3e8d0 (diff)
downloadpkgsrc-837c83c041c1ea4c97566a983efd147b47c78aca.tar.gz
Fixed the "inconsistent update" problem when using the pkgsrc wrapper
cache together with MAKE_FLAGS=-j. The cache file is now regenerated into a temporary file and then renamed (atomically) to the "real" cache file. Fixed some code that would fail when run in "set -e" mode. If you want to test the "set -e" mode, just uncomment the line in wrapper.sh.
Diffstat (limited to 'mk/wrapper/logic')
-rw-r--r--mk/wrapper/logic7
1 files changed, 4 insertions, 3 deletions
diff --git a/mk/wrapper/logic b/mk/wrapper/logic
index 679684d6978..c70f5f4c5c0 100644
--- a/mk/wrapper/logic
+++ b/mk/wrapper/logic
@@ -1,4 +1,4 @@
-# $NetBSD: logic,v 1.11 2005/02/14 21:43:11 jlam Exp $
+# $NetBSD: logic,v 1.12 2006/10/21 11:42:25 rillig Exp $
#
# Copyright (c) 2004 The NetBSD Foundation, Inc.
# All rights reserved.
@@ -56,7 +56,7 @@ while ! queue_is_empty argbuf; do
if $test $skipargs -eq 0; then
do_transform=yes
else
- skipargs=`$expr $skipargs - 1`
+ skipargs=`$expr $skipargs - 1 || true`
do_transform=no
argok=yes
continue
@@ -137,7 +137,8 @@ $cachearg) arg=$cachedarg; split_arg=$split_arg; cachehit=yes ;;
EOF
$cat $cache_header \
$cache_body \
- $cache_footer > $cache
+ $cache_footer > $cache-$$.tmp
+ $mv -f $cache-$$.tmp $cache
;;
esac
;;