summaryrefslogtreecommitdiff
path: root/mk/bulk
diff options
context:
space:
mode:
authorrillig <rillig>2006-02-07 21:34:48 +0000
committerrillig <rillig>2006-02-07 21:34:48 +0000
commit8de87c207506b020ee163eb695c5ca80e5b3b416 (patch)
tree92469b0fd1a7b054f2de1ae48416a7468f8efba0 /mk/bulk
parent84ed7e0c6f87b690e0f4bf5262606a315b8a95f6 (diff)
downloadpkgsrc-8de87c207506b020ee163eb695c5ca80e5b3b416.tar.gz
When in "set -e" mode, the Solaris /bin/sh exits when "cd" fails, even
if it occurs as the condition of a "while" or "if", or in combination with && or ||. This, of course, introduces a race condition if someone removes the directory between the two "cd"s. The result would be that the bulk build terminates, but that's not a big issue, as in this case there must be something much more severely broken.
Diffstat (limited to 'mk/bulk')
-rw-r--r--mk/bulk/pre-build8
1 files changed, 6 insertions, 2 deletions
diff --git a/mk/bulk/pre-build b/mk/bulk/pre-build
index abb86c729f9..59ec9736d89 100644
--- a/mk/bulk/pre-build
+++ b/mk/bulk/pre-build
@@ -1,5 +1,5 @@
#!/bin/sh
-# $NetBSD: pre-build,v 1.57 2006/01/29 23:07:04 rillig Exp $
+# $NetBSD: pre-build,v 1.58 2006/02/07 21:34:48 rillig Exp $
#
# Clean up system to be ready for bulk pkg build
#
@@ -111,7 +111,11 @@ PKG_TOOLS_BIN=`(cd "${PKGLINT_PKG_DIR}" && ${BMAKE} show-var VARNAME=PKG_TOOLS_B
for dbdir in "${PKG_DBDIR}" "${DEPOTBASE}"; do
echo "pre-build> Removing all installed packages in ${dbdir}"
- if cd "$dbdir" 1>/dev/null 2>&1; then
+
+ # The Solaris /bin/sh requires the following weird-looking code.
+ if (cd "$dbdir" 1>/dev/null 2>&1); then
+ cd "$dbdir"
+
for pkg in *
do
if ${PKG_TOOLS_BIN}/pkg_info -K "$dbdir" -qe "$pkg"; then