Mike Kupfer wrote:
> >>>>> "Roland" == Roland Mainz <roland.mainz at nrubsig.org> writes:
> Roland> What about this: We disable the |XPG4CMDLIST()| macro in the
> Roland> patch for now (e.g. ksh93r+) and only take those commands in
> Roland> /usr/bin/ and /bin as builtins (I volunteer to crawl through the
> Roland> sources and compare them against the Solaris versions).
> 
> If I understood correctly, the /usr/bin (and /bin) builtins are
> compatible with the Solaris version.  If that's true, then I think this
> is fine from an interface point of view.

Yes, they are... and the code seems to be OK, too (I crawled through it
in the meantime and found no possible issues (including multibyte
issues)).

I really wish we could take the builtins which are compatible to XPG4,
too - for example the loss of "expr" as builtin wheights heavy as some
scripts use it extensively and the builtin command is much much faster
than running an external command for that (well, those scripts would
have to stick /usr/xpg4/bin in front of their $PATH for ksh93 as the
ksh93 builtin implements the XPG4 behaviour (and Solaris /usr/bin/expr
is a horrible mess in multibyte locales anyway, but that complaint is
more a topic for the new shell discussions list... ;-/ )).

> The fact that we need to crawl through code is a bad sign, though.
> Duplicate code introduces the possibility of making a change in one
> place and not the other, leading to bugs.  It would be better to
> refactor, so that ksh93 and the Solaris binary can share common code.

It's on my ToDo list to sync external commands and the ksh93 builtins -
but first we need to catch a Sun lawyer and ask for the form which
allows us to contribute the code back without asking each time (in the
same way how the Sun X11 people can freely contribute to X.org under the
X11/MIT license without getting into trouble each time) ... but until
then we can IMO live with the situation of two implementations - there
are always at least three workarounds for such a problem and the number
of commands affected is very short:
-- snip --
cat
chmod
chown
head
mkdir
rmdir
sleep
tee
uniq
wc
-- snip --
"cat", "uniq", "mkdir", "rmdir", "sleep" and "wc" are very easy commands
where I can't imagine how bugs can hide in there. "chmod" was covered by
earlier postings (e.g. ACL additions by Sun's ZFS team) ... and  "tee"
and "chown" are no problems either.

----

Bye,
Roland

-- 
  __ .  . __
 (o.\ \/ /.o) roland.mainz at nrubsig.org
  \__\/\/__/  MPEG specialist, C&&JAVA&&Sun&&Unix programmer
  /O /==\ O\  TEL +49 641 7950090
 (;O/ \/ \O;)

Reply via email to