Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 50448 - baselayout 1.9.0 syntax error
Summary: baselayout 1.9.0 syntax error
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords: InVCS
: 50459 50644 50667 50673 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-05-08 06:04 UTC by Jeff
Modified: 2004-05-11 07:13 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
net.eth0.patch (net.eth0.patch,2.44 KB, patch)
2004-05-08 07:13 UTC, Sven Wegener
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jeff 2004-05-08 06:04:51 UTC
I get the following syntax error on reboot:

/sbin/rc: line 76: ((: i -lt 0: syntax error in expression (error token is "0")
Comment 1 Sven Wegener gentoo-dev 2004-05-08 06:45:36 UTC
ok, not much useful information though, but here we go.

i suppose the error is in /etc/init.d/net.eth0. 34 hours ago agriffis changed
it with the following commit message:

> In net.eth0, fix many instances of loops like "for ((i = 0; i < 100; i
> = i + 1))".  The problem here is that the middle comparison is being
> interpreted as a bash conditional, which means that it's doing string
> comparison by default.  It needs to be "i -lt 100"

The manpage of bash says that for the for loop all three arguments are
arithmetic expressions and are evaluated according to the rules of arithmetic
evaluation. comparison in artihmetic expressions is done by < and > 
according to artimethic evaluation. so the former version using <= instead
of -lt is the correct one.

for verification:

sven@morpheus sven $ for ((i = 0; i < 100; i = i + 1)); do echo $i; done
0
1
2
[...]
98
99
sven@morpheus sven $ for ((i = 0; i -lt 100; i = i + 1)); do echo $i; done
-bash: ((: i -lt 100: syntax error in expression (error token is "100")
Comment 2 Jeff 2004-05-08 07:00:20 UTC
Sorry about the lack of information...
The error does pop up right before bringing up eth0.
Comment 3 Sven Wegener gentoo-dev 2004-05-08 07:13:42 UTC
Created attachment 30994 [details, diff]
net.eth0.patch

patch between cvs revisions of net.eth0 to revert the changes
Comment 4 Aron Griffis (RETIRED) gentoo-dev 2004-05-10 06:00:23 UTC
Thanks Sven, my mistake.  I'll get this fix in
Comment 5 Aron Griffis (RETIRED) gentoo-dev 2004-05-10 06:01:31 UTC
*** Bug 50459 has been marked as a duplicate of this bug. ***
Comment 6 Aron Griffis (RETIRED) gentoo-dev 2004-05-10 07:16:51 UTC
It's in rc-scripts cvs.  I will make a new baselayout 1.9.1 release today
Comment 7 Aron Griffis (RETIRED) gentoo-dev 2004-05-10 08:17:27 UTC
baselayout-1.9.1 is in portage and baselayout-1.9.0 is removed.  Thanks again!
Comment 8 Aron Griffis (RETIRED) gentoo-dev 2004-05-10 09:40:43 UTC
*** Bug 50644 has been marked as a duplicate of this bug. ***
Comment 9 Mikael Cluseau 2004-05-10 14:42:56 UTC
*** Bug 50667 has been marked as a duplicate of this bug. ***
Comment 10 Aron Griffis (RETIRED) gentoo-dev 2004-05-11 07:13:55 UTC
*** Bug 50673 has been marked as a duplicate of this bug. ***