NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

misc/42321: build.sh reports an error (but doesn't stop) in awk script



>Number:         42321
>Category:       misc
>Synopsis:       build.sh reports an error (but doesn't stop) in awk script
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    misc-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Nov 15 11:35:00 +0000 2009
>Originator:     Alexander Nasonov
>Release:        NetBSD 5.99.22
>Organization:
>Environment:
NetBSD aa1nb.lan 5.99.22 NetBSD 5.99.22 (MONOLITHIC) #0: Sat Nov 14 16:49:42 
GMT 2009  
root%aa1nb.lan@localhost:/home/alnsn/src/netbsd-current/src/sys/arch/i386/compile/obj/MONOLITHIC
 i386

>Description:
Every time I run build.sh script, it prints an error in awk script and 
continues. I don't know whether it affects anything but this annoying message 
can be easily fixed.

See also bin/42320.

>How-To-Repeat:
$ cd /usr/src
$ LANG=ru_RU.KOI8-R AWK=/usr/bin/awk ./build.sh

or

$ LANG=ru_RU.KOI8-R AWK=/usr/bin/awk sh ./sys/conf/osrelease.sh -m
awk: syntax error at source line 1
 context is
        {print >>>  int($1+$2/100+0.01 <<< 
awk: illegal statement at source line 1

>Fix:
There are three different ways to fix this problem:

1. fix bin/42320

2. apply the patch:
$ cvs diff -U0 ./sys/conf/osrelease.sh
Index: ./sys/conf/osrelease.sh
===================================================================
RCS file: /cvsroot/src/sys/conf/osrelease.sh,v
retrieving revision 1.117
diff -U 0 -r1.117 osrelease.sh
--- ./sys/conf/osrelease.sh     29 Oct 2009 06:33:27 -0000      1.117
+++ ./sys/conf/osrelease.sh     15 Nov 2009 11:23:20 -0000
@@ -48 +48 @@
-       echo $release | $AWK -F. '{print int($1+$2/100+0.01)}'
+       echo $release | $AWK -F. '{print int($1+($2+1)/100)}'


3. apply the patch:
$ cvs diff -U0 ./sys/conf/osrelease.sh                             
Index: ./sys/conf/osrelease.sh
===================================================================
RCS file: /cvsroot/src/sys/conf/osrelease.sh,v
retrieving revision 1.117
diff -U 0 -r1.117 osrelease.sh
--- ./sys/conf/osrelease.sh     29 Oct 2009 06:33:27 -0000      1.117
+++ ./sys/conf/osrelease.sh     15 Nov 2009 11:26:08 -0000
@@ -34,0 +35,3 @@
+LC_NUMERIC=C
+export LC_NUMERIC
+



Home | Main Index | Thread Index | Old Index