[prev in list] [next in list] [prev in thread] [next in thread] 

List:       opensolaris-smf-discuss
Subject:    Re: [smf-discuss] [networking-discuss] Code review
From:       Roland Mainz <roland.mainz () nrubsig ! org>
Date:       2008-11-14 14:34:04
Message-ID: 491D8C5C.7D211AB6 () nrubsig ! org
[Download RAW message or body]

Nicolas Williams wrote:
> On Thu, Nov 06, 2008 at 09:48:51PM +0100, Roland Mainz wrote:
> > Erm... I didn't suggest to cause incompatibilties - the "ipf_include.sh"
> > is a _new_ file and all the new consumers (e.g. introduced by this
> > putback) which use it can be switched to ksh93 by replacing the first
> > like from "#!/sbin/sh" to "#!/usr/bin/ksh93" (ksh93 is sufficiently
> > backwards-compatible to the original Bourne shell that this works
> > out-of-the-box). This doesn't need to ARC'ed (and we can ask John
> > Plocher for confirmation if you want) and there is sufficent precedent
> > in OS/Net.
> 
> Oh, that's different.  The question then is: can you require that all
> consumers of ipf_include.sh be KSH93 scripts?  (I.e., will all services
> using ipf_include.sh be dependent on /usr being mounted?)

The answer is "yes" since "ipf_include.sh" already uses stuff like
/usr/bin/sed which requires /usr being mounted (somehow this reminds me
of the discussion to move ksh93 to the root filesystem since the builtin
functionality is usually sufficient to replace tools like
"sed"/"awk"/"tr"/XPG4"egrep"/etc. and help a lot in cases when /usr is
not available).

> If so then I don't see why you couldn't contribute your re-write and why
> the i-team couldn't test it (and if they don't have time now, then maybe
> you can push this right after their push, with their help for testing).

Erm... I didn't ask for a complete re-write. Usually you only replace
the shell interpreter line from Bourne shell ("#!/sbin/sh" on Solaris
Nevada) to "#!/usr/bin/ksh93" - as said ksh93 is sufficiently[1]
backwards-compatible that this should work out-of-the-box (and then you
pick the worst time-eating constructs and replace them with equivalent
ksh93 functionality).

[1]=the list of incompatibilties is quite short, so far the only
real-world issues encountered in the last three years in OS/Net and
SFWNV were:
- "unset" returns a non-zero return code when the variable does not
exist (per POSIX spec)
- "set" no longer pass-through the return code of the previous command
(another issue for POSIX conformance, however some people have argued
that this may even be a bug in the original Bourne shell which doesn't
reset the internal variable correctly)
- "(( expr ))" is no longer handled as two nested subshells (and treats
"expr" as normal command), instead POSIX uses this for arithmetric
expressions ("expr" is then a C-like arithmetric exppression,
integer-only for most POSIX shells, ksh93 extends this to full
C99-conformant floating-point support)
- { There is a 4th issue but I don't remeber that one right now }

----

Bye,
Roland

-- 
  __ .  . __
 (o.\ \/ /.o) roland.mainz@nrubsig.org
  \__\/\/__/  MPEG specialist, C&&JAVA&&Sun&&Unix programmer
  /O /==\ O\  TEL +49 641 3992797
 (;O/ \/ \O;)
_______________________________________________
smf-discuss mailing list
smf-discuss@opensolaris.org
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic