Subject: pkg/20826: parallel/pvm3 fails to install
To: None <gnats-bugs@gnats.netbsd.org>
From: None <jbernard@mines.edu>
List: netbsd-bugs
Date: 03/20/2003 16:32:06
>Number:         20826
>Category:       pkg
>Synopsis:       parallel/pvm3 fails to install
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Mar 20 15:33:00 PST 2003
>Closed-Date:
>Last-Modified:
>Originator:     Jim Bernard
>Release:        NetBSD 1.6P
>Organization:
>Environment:
System: NetBSD nool 1.6P NetBSD 1.6P (NOOL-$Revision: 1.35 $) #0: Sun Mar 16 12:27:03 MST 2003 jim@roc:/wd1/var/tmp/compile/sys/arch/i386/compile/NOOL i386
Architecture: i386
Machine: i386
>Description:
	At installation (make install) after building from source, the
	tr command that builds _PVM_ARCH for use in constructing PVM_ARCH
	fails:
	  
usage: tr [-cs] string1 string2
       tr [-c] -d string1
       tr [-c] -s string1
       tr [-c] -ds string1 string2
make: "/usr/local/src/netbsd-current/usr/pkgsrc/parallel/pvm3/arch.mk" line 8: warning: "echo i386 | /usr/bin/tr [a-z] [A-Z]" returned non-zero status

	causing one of the install commands to fail because PVM_ARCH is
	incorrectly set to NETBSD instead of NETBSDI386:

install -c -s -o root -g wheel -m 555 /home/usr.local/src/netbsd-current/usr/pkgsrc/parallel/pvm3/work.nool/pvm3/bin/NETBSD/*                     /usr/pkg/pvm3/bin/NETBSD
install: /home/usr.local/src/netbsd-current/usr/pkgsrc/parallel/pvm3/work.nool/pvm3/bin/NETBSD/*: stat: No such file or directory
*** Error code 1

>How-To-Repeat:
	make && make install
>Fix:
	Quoting the arguments to tr in arch.mk fixes the problem.

	Curiously, bash evaluates the command

	  echo i386 | /usr/bin/tr [a-z] [A-Z]

	successfully, whereas our sh does not.  Is this a bug in sh
	or a bug in bash, or is either behavior deemed acceptable?
	In any case, it seems like a good idea to quote the arguments
	in arch.mk.

--- arch.mk-dist	2002-10-30 03:48:03.000000000 -0700
+++ arch.mk	2003-03-20 16:04:16.000000000 -0700
@@ -3,11 +3,11 @@
 
 .include "../../mk/bsd.prefs.mk"
 
 .if ${OPSYS} == "NetBSD"
 _PVM_OPSYS=	NETBSD
-_PVM_ARCH!=	${ECHO} ${MACHINE_ARCH} | ${TR} [a-z] [A-Z]
+_PVM_ARCH!=	${ECHO} ${MACHINE_ARCH} | ${TR} "[a-z]" "[A-Z]"
 .elif ${OPSYS} == "Linux"
 _PVM_OPSYS=	LINUX
 .  if !empty(MACHINE_ARCH:Malpha*)
 _PVM_ARCH=	ALPHA
 .  elif !empty(MACHINE_ARCH:Marm*)
>Release-Note:
>Audit-Trail:
>Unformatted: