zsh-workers
 help / color / mirror / code / Atom feed
* Some comments on Mandrake zsh RPMs
@ 2000-02-07  8:35 Bart Schaefer
  2000-02-07  9:41 ` Bart Schaefer
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Bart Schaefer @ 2000-02-07  8:35 UTC (permalink / raw)
  Cc: zsh-workers

Actually, this can all be summed up in one comment:

Just because zsh provides for /etc/z{shenv,profile,shrc,login,logout}
doesn't mean they should all be non-empty.  In fact, they shouldn't be
there at all unless there's a *very* good reason for them to be.

Let's talk about a few of the things that are present in Mandrake's
/etc/z* files.

In /etc/zshenv, which at least has some reason to exist:

 if [ `id -u` -eq 0 ]; then
   path=(/sbin /usr/sbin)
 fi

This is something copied from RedHat.  The best thing about it is that it
helped me find a race condition in backtick evaluation, about a year ago.
It would be much better written:

 if (( EUID == 0 )); then

Following that, there's:

 echo $PATH | /bin/grep -q "\W$X11HOME/bin:" || path=($path $X11HOME/bin)
 echo $PATH | /bin/grep -q "\W/bin:" || path=($path /bin)

And so on.  All those pipes and greps are just cruft.  All that's needed:

 typeset -U path
 path=($path $X11HOME/bin /bin /usr/bin /usr/local/bin)

In /etc/zprofile is this:

 if [[ $(id -gn) = $(id -un) && $(id -u) -gt 14 ]]; then
         umask 002
 else
         umask 022
 fi

This is actually repeated verbatim in /etc/zshrc, which is the better
place for it; all interactive shells read zshrc, but only login shells
read zprofile.  Wherever it's put, only one of those $(id ...) is
necessary:

 if [[ $(id -gn) = $USERNAME && $EUID -gt 14 ]]; then

Next is /etc/zshrc, which is pretty bad.

If it's really necessary to source /etc/profile.d/*.sh, of which I am not
convinced, at least it might be wise to do it in /etc/zprofile rather than
in /etc/zshrc.  RedHat has it in zprofile, but thankfully commented out.

Then there's this:

 export USER=$(id -un)
 export LOGNAME=$USER
 export HOSTNAME=$(/bin/hostname)

LOGNAME is set automatically by zsh.  So are USERNAME and HOST.  If it's
really necessary to have USER and HOSTNAME, use:

 export USER=$USERNAME
 export HOSTNAME=$HOST

Next is:

 path=($path $HOME/bin)
 export PATH=$PATH:$HOME/bin

After all that extra work in zshenv to avoid adding the same directory to
the path multiple times, here $HOME/bin is added twice!  $PATH is
automatically kept in sync when $path is assigned, and is exported by
default.  Drop the "export" line.

One last specific suggestion:

 zmodload | grep -q complist || zmodload complist

is better expressed as

 zmodload -ui complist

where the -i option for "ignore" causes it to be silent if the module
is already loaded.  In -dev-16 and later, it's more correct to use

 zmodload -ui zsh/complist

because the naming convention has changed.

Now some general griping:

I won't comment specifically on all the aliases except to say that I don't
think they should be there.  Particularly "alias -g" can badly confuse an
unsuspecting user; how do YOU know that I never create a file named "G" or
"L" or "O"?

The bindkey for magic-space is another RedHat gratuity.  It's not strictly
wrong for it to be there, but the behavior can be annoying to a fast
typist.  It's particularly bad if you're attempting to embed a space in
a history reference.

I also find the large collection of setopts to be gratuitous.  Why turn
off completeinword?  (It's off by default, so the only possible reason is
to override a user setting; ick.)  Isn't interactivecomments potentially
confusing?  And the best reasons I can think of for setting kshglob,
posixbuiltins, and rcexpandparam are to parse /etc/profile.d/* correctly
(in which case ksharrays might also be needed); but the setopts come much
too late for that.  I'd prefer they weren't there at all.

I'm curious, what users did you have in mind when making these choices?

OK, enough griping.  You have a chance here to take yet another thing that
RedHat botched and improve on it; please do, rather than making it worse.
Thanks for listening.

-- 
Bart Schaefer
Maintainer, zsh 3.0 series


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Some comments on Mandrake zsh RPMs
  2000-02-07  8:35 Some comments on Mandrake zsh RPMs Bart Schaefer
@ 2000-02-07  9:41 ` Bart Schaefer
  2000-02-09 16:09 ` Chmouel Boudjnah
  2000-02-09 21:49 ` Adam Spiers
  2 siblings, 0 replies; 6+ messages in thread
From: Bart Schaefer @ 2000-02-07  9:41 UTC (permalink / raw)
  To: zsh-workers

On Feb 7, 12:35am, Bart Schaefer wrote:
} Subject: Some comments on Mandrake zsh RPMs
}
} Let's talk about a few of the things that are present in Mandrake's
} /etc/z* files.

In case you didn't notice, this rant was posted to alt.os.linux.mandrake,
and a copy sent to zsh-workers.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Some comments on Mandrake zsh RPMs
  2000-02-07  8:35 Some comments on Mandrake zsh RPMs Bart Schaefer
  2000-02-07  9:41 ` Bart Schaefer
@ 2000-02-09 16:09 ` Chmouel Boudjnah
  2000-02-10  2:25   ` Bart Schaefer
  2000-02-09 21:49 ` Adam Spiers
  2 siblings, 1 reply; 6+ messages in thread
From: Chmouel Boudjnah @ 2000-02-09 16:09 UTC (permalink / raw)
  To: Bart Schaefer; +Cc: zsh-workers

Bart Schaefer <schaefer@zsh.org> writes:

Hi Bart,

> Actually, this can all be summed up in one comment:
> Just because zsh provides for /etc/z{shenv,profile,shrc,login,logout}
> doesn't mean they should all be non-empty.  In fact, they shouldn't be
> there at all unless there's a *very* good reason for them to be.
> Let's talk about a few of the things that are present in Mandrake's
> /etc/z* files.

Thanks for your comments i did most of the modifications as you have
suggested, before i upload to cooker[1], i'll be glad to know if you
think[2] the default config is ok. The (s)rpm is based here :

ftp://ftp.mandrakesoft.com:/pub/chmou/zsh-3.1.6dev17-1mdk.i586.rpm
ftp://ftp.mandrakesoft.com:/pub/chmou/zsh-3.1.6dev17-1mdk.src.rpm

Regards.

Footnotes: 
[1]  http://www.linuxmandrake.com/cooker/ 
[2]  or others zsh hackers.

                                  --Chmouel


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Some comments on Mandrake zsh RPMs
  2000-02-07  8:35 Some comments on Mandrake zsh RPMs Bart Schaefer
  2000-02-07  9:41 ` Bart Schaefer
  2000-02-09 16:09 ` Chmouel Boudjnah
@ 2000-02-09 21:49 ` Adam Spiers
  2 siblings, 0 replies; 6+ messages in thread
From: Adam Spiers @ 2000-02-09 21:49 UTC (permalink / raw)
  To: zsh-workers

Bart Schaefer (schaefer@zsh.org) wrote:
> Actually, this can all be summed up in one comment:
> 
> Just because zsh provides for /etc/z{shenv,profile,shrc,login,logout}
> doesn't mean they should all be non-empty.  In fact, they shouldn't be
> there at all unless there's a *very* good reason for them to be.

[snip various problems with global zsh{env,rc} in Mandrake and RedHat
rpms]

Just thought I'd mention that I've modified the relevant files in my
automated nightly built RPMs according to Bart's criticisms, since
they were also derived from the problematic RedHat originals.  Hope
they're approaching "correctness" now.  I also even fixed the nightly
build process so that it actually works now :-)

In case anyone's still interested (surprisingly, a few people have
been in the past), they're still at:

  http://www.new.ox.ac.uk/~adam/computing/zsh/

Adam


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Some comments on Mandrake zsh RPMs
  2000-02-09 16:09 ` Chmouel Boudjnah
@ 2000-02-10  2:25   ` Bart Schaefer
  2000-02-10  9:09     ` Chmouel Boudjnah
  0 siblings, 1 reply; 6+ messages in thread
From: Bart Schaefer @ 2000-02-10  2:25 UTC (permalink / raw)
  To: Chmouel Boudjnah; +Cc: zsh-workers

On Feb 9,  5:09pm, Chmouel Boudjnah wrote:
> Subject: Re: Some comments on Mandrake zsh RPMs
> 
> Thanks for your comments i did most of the modifications as you have
> suggested, before i upload to cooker[1], i'll be glad to know if you
> think[2] the default config is ok.

That certainly looks much better.  There are a couple of typos in some
comments but I can't seriously argue with any of the actual code.

One remark on the binary RPM -- you probably didn't mean to include this:
/usr/doc/zsh-3.1.6dev17/Documentation/Makefile.in

And thanks again for paying attention.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Some comments on Mandrake zsh RPMs
  2000-02-10  2:25   ` Bart Schaefer
@ 2000-02-10  9:09     ` Chmouel Boudjnah
  0 siblings, 0 replies; 6+ messages in thread
From: Chmouel Boudjnah @ 2000-02-10  9:09 UTC (permalink / raw)
  To: Bart Schaefer; +Cc: Chmouel Boudjnah, zsh-workers

"Bart Schaefer" <schaefer@candle.brasslantern.com> writes:

> That certainly looks much better.  There are a couple of typos in some
> comments but I can't seriously argue with any of the actual code.

Typing on a deutch keyboard it's a pain, yep i'll fix that.

> One remark on the binary RPM -- you probably didn't mean to include this:
> /usr/doc/zsh-3.1.6dev17/Documentation/Makefile.in

Right, thanks.

> And thanks again for paying attention.

Thanks for your remarks.

                                  --Chmouel


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2000-02-10 18:09 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-02-07  8:35 Some comments on Mandrake zsh RPMs Bart Schaefer
2000-02-07  9:41 ` Bart Schaefer
2000-02-09 16:09 ` Chmouel Boudjnah
2000-02-10  2:25   ` Bart Schaefer
2000-02-10  9:09     ` Chmouel Boudjnah
2000-02-09 21:49 ` Adam Spiers

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).