Subject: pkg/37123: mk/bulk/do-sandbox-build breakage with "sh" on Solaris
To: None <pkg-manager@netbsd.org, gnats-admin@netbsd.org,>
From: None <uli@habel.name>
List: pkgsrc-bugs
Date: 10/12/2007 22:05:01
>Number:         37123
>Category:       pkg
>Synopsis:       mk/bulk/do-sandbox-build breakage with "sh"  on Solaris
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Fri Oct 12 22:05:01 +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:
The script mk/bulk/do-sandbox-build calls the script "build" with the /bin/sh shell. The command fails to a incompatible sh shell on Solaris.
>How-To-Repeat:
call the script mk/bulk/do-sandbox-build on a Solaris host
>Fix:
I added an opsys detection to the script and set the sh variable to /bin/ksh if the OS is SunOS.

the patch is below:

--- do-sandbox-upload.orig      2007-10-12 16:38:41.000000000 +0200
+++ do-sandbox-upload   2007-10-12 17:08:21.000000000 +0200
@@ -2,12 +2,19 @@
 #      $NetBSD: do-sandbox-upload,v 1.5 2005/07/13 22:07:46 rillig Exp $

 #
-# Script to start a sandbox build
+# Script to upload a sandbox build
 #
 # See pkgsrc/doc/pkgsrc.txt for documentation!
 #

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

 chroot /usr/sandbox \