[Pkg-zsh-devel] [PATCH 1/3…3/3] Several tweaks to d/zshrc's new completion enablement

Axel Beckert abe at debian.org
Mon Feb 17 11:39:29 GMT 2020


Hi Daniel,

thanks for the patches! (Some comments on them below.)

Daniel Shahaf wrote:
> I'm not sure I understand why the Debian package has code that will only
> run on Ubuntu.

Because it is preferred if Debian and Ubuntu source packages don't
differ, but Ubuntu insists on enabling completion by default while we
at some point decided that we IIRC want the default to be rather
minimal and not even contain autocompletion.

> It requires the Ubuntu maintainers to go through Debian
> whenever they want to make Ubuntu-specific changes.

No, it's more the opposite way round:

As of now, for _every_ zsh upload we make, Ubuntu has to go through
our changes and see what changed and which of their changes need to be
rebased and which of them can be dropped.

This also meant that zsh packages migrating from Debian to Ubuntu
always was a manual thing, which caused Ubuntu often to lag behind a
lot wrt, to upstream versions. And they also skip integrating many of
our uploads because of that.

Since cross-building support (which is generally a good thing) and
this zshrc change were the last Ubuntu-specific patches which were
remaining, I decided to make life easier for the Ubuntu maintainers
(no more manual merging Debian's zsh packages) and allow us to
propagate our packages way more quickly to Ubuntu.

After the upload of 5.8-2 I plan to contact some of those Ubuntu devs
who previously merged zsh to ask them to merge the package unmodified.

One reason to do this now is to get zsh 5.8 into Ubuntu before the
feature freeze for Ubuntu 20.04 LTS on 27th of February.

> Wouldn't it be better to have a standard way for downstream distros
> to add their hooks?

Sure. But unless these files come from a separate package, we're at
the same situation as before (respectively now): The Ubuntu guys would
need to find time, to merge zsh manually from Debian. I really want to
avoid that.

> For example, «() { [[ -e $1 ]] && source $1 }
> /etc/zsh/zshrc.$(lsb_release -si)»?

No, at least not with lsb_release. I deliberately used /etc/os-release
as that is coming from the package base-files which is "Essential" and
hence guaranteed to exist. I don't want to pull in lsb-release and
with it python3 if I can avoid it.

Regarding the patches:

> Subject: [PATCH 1/3] Fix advice in comment: zprofile isn't sourced by
>  non-login interactive shells.

Looks fine, thanks!

> Subject: [PATCH 2/3] Rearrange condition to take advantage of
>  short-circuiting.

Not sure what you mean with "short-circuiting" here.

> -if grep -q 'ID.*=.*ubuntu' /etc/os-release && [[ -z "$skip_global_compinit" ]]; then
> +if [[ -z "$skip_global_compinit" ]] && grep -q 'ID.*=.*ubuntu' /etc/os-release; then
>    autoload -U compinit
>    compinit
>  fi

So the difference seems, that if someone (on Ubuntu or elsewhere)
doesn't want autocompletion initialised, we save checking if it's on
Ubuntu or not?

Do we want to make $skip_global_compinit a difference (in startup
performance) anywhere else, too?

> Subject: [PATCH 3/3] d/zshrc: Tighten regex
> 
> It matched VERSION_ID and might match other keys or values as well.

Good catch, thanks!

		Regards, Axel
-- 
 ,''`.  |  Axel Beckert <abe at debian.org>, https://people.debian.org/~abe/
: :' :  |  Debian Developer, ftp.ch.debian.org Admin
`. `'   |  4096R: 2517 B724 C5F6 CA99 5329  6E61 2FF9 CD59 6126 16B5
  `-    |  1024D: F067 EA27 26B9 C3FC 1486  202E C09E 1D89 9593 0EDE



More information about the Pkg-zsh-devel mailing list