On 9/13/06, Quayle, Bill <[EMAIL PROTECTED]> wrote:
The SUNWuti-3.1-32.i386.rpm contains a library called "iu_lib"
On line 466 of that file, and within the GetPackagePath function is the
line:
  typeset -r ProductName="$1"
When the GetPackagePath function is called from the installer, it tries
to set ProductName, which is, of course, read only and cannot be set.

A variable defined read-only by 'typeset -r' can have its value set
by the definition statement, and that's exactly what's happening on
that line.  *Subsequent* attempts to change the value of the variable
will fail.

Variables defined by 'typeset' within a function are local variables,
for a slightly funky definition of "local" that includes the function that
defines the variable and any functions called by that function.
GetPackagePath doesn't call itself or any other functions so there
can't be a clash caused by recursion.  When GetPackagePath returns
the ProductName variable should disappear, and on the next call to
GetPackagePath a brand-new ProductName variable should be created.

What seems to be happening in the cases where this blows up is that
the shell does not forget the ProductName variable when the
GetPackageName function returns.  It's as though the shell keeps the
variable's definition intact, such that the 'typeset -r' invocation in the
next call to GetPackageName is treated as an attempt to assign a value
to an already-defined read-only variable, and that's an error.

I'm not sure why this works under Solaris, but if you change the line to
read:
  typeset ProductName="$1"
re-build the rpm and stuff it back in place, you should be good to go.

It works on Solaris, and on Linux, because that's how ksh is supposed
to behave.  We've never seen this failure inside Sun.

Where did your /bin/ksh executable come from?  (Did you install the
pdksh RPM from the Supplemental area of the SRSS image?)

What does 'echo $ProductName' say in the shell you ran 'utinstall'
from?

I see that some of the installer scripts don't invoke ksh with a -p
option.  IMO that's a bug but I don't know whether it bears on this
problem.  Just for fun, what's in /.profile on this machine and, if the
shell you ran 'utinstall' has a $ENV variable defined, what's in the
file pointed to by $ENV?

OttoM.
__
ottomeister

Disclaimer: These are my opinions.  I do not speak for my employer.
_______________________________________________
SunRay-Users mailing list
[email protected]
http://www.filibeto.org/mailman/listinfo/sunray-users

Reply via email to