Closed Bug 456719 Opened 16 years ago Closed 15 years ago

run-mozilla.sh doesn't work well with ksh93

Categories

(Toolkit :: Startup and Profile System, defect)

x86
OpenSolaris
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: ginnchen+exoracle, Assigned: ginnchen+exoracle)

Details

Attachments

(1 file, 2 obsolete files)

On OpenSolaris, /bin/sh is ksh93.

I found two problems with run-mozilla.sh.

1) In ksh93, type is an alias for 'whence -v'
I've dbx in /opt/SUNWspro/bin/dbx
type dbx result is
dbx is a tracked alias for /opt/SUNWspro/bin/dbx
thus type ${d} | awk '{print $3;}' | sed -e 's/\.$//' result is "a" not "/opt/SUNWspro/bin/dbx"

2) /bin is symbolic link to ./usr/bin, /bin/firefox is symbolic link to ../lib/firefox/firefox
Firefox is in /usr/lib/firefox/firefox.
/bin/firefox would not start, because in "cd ../lib/firefox" would not work from /bin
We need to use "cd -P ../lib/firefox" instead.
"cd -P" is valid for ksh93 and bash, but not Bourne shell.


For problem 1, we can switch the priority of "which" and "type".
For problem 2, we can use "cd -P "$curdir" 2>/dev/null || cd "$curdir" as Roland Mainz suggested at
http://bugs.grommit.com/show_bug.cgi?id=559#c10

Or maybe we can add a patch just for Solaris, after installing firefox and run-mozilla.sh script to dist/bin replace #!/bin/sh to #!/bin/bash.

I wish the fix can be done in mozilla-central repository, so I won't hold this patch myself.
I really feel the inconvenience, every time I type "./dist/bin/firefox -g -d dbx", it fails.
Can you provide a patch?
Component: Cmd-line Features → Startup and Profile System
Product: Core → Toolkit
QA Contact: cmd-line → startup
Assignee: nobody → ginn.chen
Status: NEW → ASSIGNED
Attachment #384383 - Flags: review?(benjamin)
1) can't this be fixed by using /bin/type explicitly instead of bare type?
2) why is /bin/firefox a relative symbolic link? If that file is even part of our install target (I think it's not) it ought to be using an absolute symlink, not a relative one!

I don't particularly want to use bash if there's simple workarounds to make it sh-compatible.
Comment on attachment 384383 [details] [diff] [review]
replace !/bin/sh to !/bin/bash on Solaris

Clearing request. Please re-request if making is sh-compatible is really not practical.
Attachment #384383 - Flags: review?(benjamin)
Attached patch patch to make ksh compatible (obsolete) — Splinter Review
1)
/bin/type works as same as bare type under ksh93.
So what I can do is to try to use /bin/which.

2)
Relative symbolic link is common, on Ubuntu, /usr/bin/firefox-3.0 is link to ../lib/firefox-3.0.10/firefox.sh.
The problem is on Solaris /bin is a symbolic link to ./usr/bin, and be default, ksh handles the operand dot-dot (..) logically.
So as Roland Mainz suggested, try to use option "-P" first.
Attachment #384383 - Attachment is obsolete: true
Attachment #387145 - Flags: review?(benjamin)
Comment on attachment 387145 [details] [diff] [review]
patch to make ksh compatible

Is cd -P portable?
Attachment #387145 - Flags: review?(benjamin) → review+
Comment on attachment 387145 [details] [diff] [review]
patch to make ksh compatible

Unfortunately it's not.
And cd -P "$curdir" 2>/dev/null || cd "$curdir" can't get around.
Attachment #387145 - Attachment is obsolete: true
Attachment #387145 - Flags: review+
Attached patch patch v2Splinter Review
Use /bin/pwd to resolve symlink of dirname
Attachment #389109 - Flags: review?(benjamin)
Attachment #389109 - Flags: review?(benjamin) → review+
http://hg.mozilla.org/mozilla-central/rev/d783d91beec5
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: