This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 43730 - nbexec fails on Solaris
Summary: nbexec fails on Solaris
Status: CLOSED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Execution (show other bugs)
Version: 4.x
Hardware: PC Solaris
: P1 blocker (vote)
Assignee: Petr Nejedly
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-05-24 13:42 UTC by Vladimir Hudec
Modified: 2008-12-22 21:23 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Hudec 2004-05-24 13:42:56 UTC
indxCls=`expr index "$doCls" ":"`
doesn't work on Solaris
Comment 1 _ ttran 2004-05-26 10:36:17 UTC
Petre, please solve this asap.  Yarda is not here this week
Comment 2 Petr Nejedly 2004-05-26 10:54:17 UTC
Working on it
Comment 3 Petr Nejedly 2004-05-26 11:13:00 UTC
Seems I have a solution not using expr at all, simpler and faster.
Still testing...
Comment 4 Petr Nejedly 2004-05-26 11:54:41 UTC
Hmm, I hate bourne shell.
Need another solution, my simple and nice solution needs bash,
I only happened to have bash as /bin/sh on my solaris box ;-)
Comment 5 Petr Nejedly 2004-05-26 12:33:00 UTC
I believe I've fixed it properly now. Please test it.
core/launcher/unix/nbexec,v1.9
Comment 6 Vladimir Hudec 2004-05-26 12:42:13 UTC
Still one expr index is used in the script.
Comment 7 Petr Nejedly 2004-05-26 12:50:12 UTC
Fixed even the second occurence, hope it is OK now.
Comment 8 Vladimir Hudec 2004-05-26 13:42:46 UTC
verified on Sparc Solaris
Comment 9 Jaroslav Tulach 2004-05-26 18:58:28 UTC
IFS solution seems to be much better than mangling with expr. Thanks
that the issue got to you -Petr, but I have executed following statement:

save=$IFS; IFS=':'; for i in x:y:z ; do echo $i; done; IFS=$save

and received:

x y z

maybe I did some mistake, but should not I get
x
y
z
instead? What is really needed is to iterate over all --clusters. Does
there really work or we are not seeing immediate problems (unknown
agruments to a command) on solaris?
Comment 10 Vladimir Hudec 2004-05-26 19:11:04 UTC
I can't see any shell problems, this is, what I tested.
I haven't tested functionality of the NetBeans itself, I suppose
it'll be done by QE.
Comment 11 Petr Nejedly 2004-05-27 08:55:54 UTC
OK, Yarda, the problem is that your script use the modified IFS also
for the inner loop commands, while in my patch, I do reset the IFS
from inside the cycle. That way, the modified IFS is used for the
setup of the loop, yet it is correct the the function called from the
loop.
Try putting some echos in the nbexec (e.g. inside the ..._pre_...)
to verify passed agrs (so it is called for each cluster) and to check
IFS. I did so and it was OK.

Comment 12 Petr Nejedly 2004-05-27 09:11:37 UTC
If we are at the bourne shell teaching course now ;-) one more note.
Your example didn't work, as the literal 'x:y:z' was never processed
using IFS, your loop was run only once and when $i was once
substituted for echo, it was turned into three arguments.
As you see, it has to go through the substitution to actually apply
IFS, so try this:
list="x:y:z"; save=$IFS; IFS=':'; for i in $list ; do echo $i; done;
IFS=$save

er even better:
list='x:y:z'; save=$IFS; llist=$list; IFS=$save; for i in $llist; do
echo --$i--; done

Is it clear now?
Comment 13 Jaroslav Tulach 2004-05-30 16:49:19 UTC
Yes.
Comment 14 Petr Nejedly 2004-05-30 21:29:20 UTC
OK, just for fun, a short historical note:
The very original Bourne Shell (that unportable thing running on
PDP-11) even applied IFS to literals, so command
IFS='o' viola
would start vi on file named "la"