NetBSD Problem Report #30425

From gcw@primenet.com.au  Sat Jun  4 10:19:46 2005
Return-Path: <gcw@primenet.com.au>
Received: from g.primenet.com.au (g.primenet.com.au [203.24.36.10])
	by narn.netbsd.org (Postfix) with ESMTP id 938A963B104
	for <gnats-bugs@gnats.NetBSD.org>; Sat,  4 Jun 2005 10:19:44 +0000 (UTC)
Message-Id: <20050604101938.15754.qmail@g.primenet.com.au>
Date: 4 Jun 2005 20:19:38 +1000
From: gcw@primenet.com.au
Reply-To: gcw@primenet.com.au
To: gnats-bugs@netbsd.org
Subject: genassym usage failure in kernel building after May 2005 changes
X-Send-Pr-Version: 3.95

>Number:         30425
>Category:       kern
>Synopsis:       genassym is not used properly anymore in sys/conf/Makefile.kern.inc
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Jun 04 10:20:00 +0000 2005
>Closed-Date:    Sat Nov 28 20:33:02 +0000 2009
>Last-Modified:  Sat Nov 28 20:35:01 +0000 2009
>Originator:     Geoff C. Wing
>Release:        NetBSD 3.99.5 (2005-06-03)
>Organization:
>Environment:
System: NetBSD g.primenet.com.au 3.99.5 NetBSD 3.99.5 (G) #0: Mon May 30 14:02:30 EST 2005 gcw@g.primenet.com.au:/usr/netbsd/src/sys/arch/i386/compile/G i386
Architecture: i386
Machine: i386
>Description:
	The changes in how genassym is used to build assym.h for a kernel
	causes problems with unknown kernel options having spaces or
	globbing characters
	e.g. in a kernel config I have ``options MSGBUFSIZE="(32 * 1024)"''.

	Unfortunately this is converted to  -DMSGBUFSIZE="(32 * 1024)"
	when passed through the compilation.  genassym gets it and expands
	it to
	    -DMSGBUFSIZE=( {...every file in the compile dir...} 1024)

>How-To-Repeat:
	add the line above.  Try it.
>Fix:
	I'll think about it in a bit if nobody else does.

>Release-Note:

>Audit-Trail:
From: List Mail User <track@Plectere.com>
To: gnats-bugs@NetBSD.org
Cc: track@Plectere.com
Subject: Re: kern/30425: genassym usage failure in kernel building after May 2005 changes
Date: Sat, 4 Jun 2005 12:57:34 -0700 (PDT)

 >...
 >>Number:         30425
 >>Category:       kern
 >>Synopsis:       genassym is not used properly anymore in sys/conf/Makefile.kern.inc
 >>Confidential:   no
 >>Severity:       non-critical
 >>Priority:       low
 >>Responsible:    kern-bug-people
 >>State:          open
 >>Class:          sw-bug
 >>Submitter-Id:   net
 >>Arrival-Date:   Sat Jun 04 10:20:00 +0000 2005
 >>Originator:     Geoff C. Wing
 >>Release:        NetBSD 3.99.5 (2005-06-03)
 >>Organization:
 >>Environment:
 >System: NetBSD g.primenet.com.au 3.99.5 NetBSD 3.99.5 (G) #0: Mon May 30 14:02:30 EST 2005 gcw@g.primenet.com.au:/usr/netbsd/src/sys/arch/i386/compile/G i386
 >Architecture: i386
 >Machine: i386
 >>Description:
 >	The changes in how genassym is used to build assym.h for a kernel
 >	causes problems with unknown kernel options having spaces or
 >	globbing characters
 >	e.g. in a kernel config I have ``options MSGBUFSIZE="(32 * 1024)"''.
 >
 >	Unfortunately this is converted to  -DMSGBUFSIZE="(32 * 1024)"
 >	when passed through the compilation.  genassym gets it and expands
 >	it to
 >	    -DMSGBUFSIZE=( {...every file in the compile dir...} 1024)
 >
 >>How-To-Repeat:
 >	add the line above.  Try it.
 >>Fix:
 >	I'll think about it in a bit if nobody else does.
 >
 >
 	Not a fix, but the trivial workaround of using:

 options MSGBUFSIZE="(8*NBPG)"

 	or anything similar without the spaces or by escaping the wildcard
 character as in:

 options MSGBUFSIZE="(8 \* NBPG)"

 does function as expected (of course, the first example depends on the lack
 of any file which matches the still potentially expanded wildcard).

 	This does not mean that the bug doesn't exist or shouldn't be fixed;
 It is a "regression, since it used to work:  Just I have such a line in nearly
 every kernel config file I use.


 	Paul Shupak
 	track@plectere.com

From: Geoff Wing <gcw@pobox.com>
To: NetBSD GNATS <gnats-bugs@netbsd.org>
Cc: 
Subject: Re: kern/30425: genassym usage failure (now with patch)
Date: Sat, 20 Aug 2005 19:59:41 +1000

 The getopts builtin was in my 1991 POSIX draft.  The usage
 args=`getopt ....` should have been deprecated at least that long.
 Even given that this is a build tool, we should be able to expect
 anyone building us to have a /bin/sh able to handle this.

 /usr/sbin/etcupdate and /usr/sbin/ypinit could also be changed.
 Maybe also a note in getopt.1 ?

 Fix is something like (maybe spew out usage on bad args?):

 --- usr.bin/genassym/genassym.sh.~1~	2005-08-20 19:54:06.000000000 +1000
 +++ usr.bin/genassym/genassym.sh	2005-08-20 19:54:06.000000000 +1000
 @@ -42,25 +42,22 @@
  	echo "usage: ${progname} [-c | -f] -- compiler command" >&2
  }

 -args=`getopt cf $*`
 -if [ $? != 0 ]; then
 -	usage;
 -	exit 1;
 -fi
 -set -- $args
 -
 -for i; do
 +while getopts cf i
 +do
  	case "$i" in
 -	-c)
 +	c)
  		ccode=1
 -		shift;;
 -	-f)
 +		;;
 +	f)
  		fcode=1
 -		shift;;
 -	--)
 -		shift; break;;
 +		;;
  	esac
  done
 +shift `expr $OPTIND - 1`
 +if [ $# -eq 0 ]; then
 +	usage
 +	exit 1
 +fi

  # Deal with any leading environment settings..


State-Changed-From-To: open->closed
State-Changed-By: dsl@NetBSD.org
State-Changed-When: Sat, 28 Nov 2009 20:33:02 +0000
State-Changed-Why:
Change applied


From: David Laight <dsl@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/30425 CVS commit: src/usr.bin/genassym
Date: Sat, 28 Nov 2009 20:30:02 +0000

 Module Name:	src
 Committed By:	dsl
 Date:		Sat Nov 28 20:30:02 UTC 2009

 Modified Files:
 	src/usr.bin/genassym: genassym.sh

 Log Message:
 Use shell builtin getopts instead of getopt(1).
 Fixes PR/30425


 To generate a diff of this commit:
 cvs rdiff -u -r1.5 -r1.6 src/usr.bin/genassym/genassym.sh

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.