summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorrillig <rillig@pkgsrc.org>2006-02-07 21:34:48 +0000
committerrillig <rillig@pkgsrc.org>2006-02-07 21:34:48 +0000
commitd846e3c2b5f8987ae94c5dfa2cd0fbeb5d3d819b (patch)
tree92469b0fd1a7b054f2de1ae48416a7468f8efba0 /mk
parentdc62cf942cd3024abf45996acffddc1b5bf80cf8 (diff)
downloadpkgsrc-d846e3c2b5f8987ae94c5dfa2cd0fbeb5d3d819b.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')
-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