Subject: pkg/36415: mk/bulk/do-sandbox-build fails on Solaris 9
To: None <pkg-manager@netbsd.org, gnats-admin@netbsd.org,>
From: None <uli@habel.name>
List: pkgsrc-bugs
Date: 05/30/2007 12:45:00
>Number:         36415
>Category:       pkg
>Synopsis:       mk/bulk/do-sandbox-build fails on Solaris 9
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Wed May 30 12:45:00 +0000 2007
>Originator:     Ulrich Habel
>Release:        Solaris 5.9/sparc
>Organization:
>Environment:
SunOS sun-install 5.9 Generic_122300-07 sun4u sparc SUNW,Sun-Fire-V240
>Description:
On Solaris the shell "sh" seems to be terribly broken. It's known for a longer time, however do-sandbox-build is a script that uses "/bin/sh" in hardcoded form and so the script fails with the following error:

mk/bulk/build: error:
    Error reading the variables.
    Try running mk/bulk/build with another shell.
>How-To-Repeat:
run mk/bulk/do-sandbox-build on a Solaris 9 system
>Fix:
A good way would be the detection of the OS - I've attached a small patch to address this issue:

--- mk/bulk/do-sandbox-build.orig       2007-05-30 07:55:14.348951000 +0200
+++ mk/bulk/do-sandbox-build    2007-05-30 07:53:31.384740000 +0200
@@ -7,7 +7,15 @@
 # See pkgsrc/doc/pkgsrc.txt for documentation!
 #

-sh="/bin/sh"
+opsys=`uname -s`
+case "$opsys" in
+       SunOS)
+               sh="/bin/ksh"
+               ;;
+       *)
+               sh="/bin/sh"
+               ;;
+esac
 build="mk/bulk/build"

 chroot /usr/sandbox \