[Pkg-zsh-devel] Zsh Upload to Experimental ahead: debian/rules with "dh $@" and support for /etc/zsh/zprofile.d/ or so

Axel Beckert abe at debian.org
Sun Nov 12 15:21:06 UTC 2017


Hi,

I already tried once in the past to switch zsh to a "%:" + "dh $@"
style debian/rules file, but didn't have the right point of view to
succeed. Yesterday, after having implemented out-of-tree building for
the two binary variants of links2 (full-featured and minimal) to be
able to use debhelper compat level 10 there, it suddenly came to me
how I need to implement it for zsh, too.

So there is now a feature branch called min-dh-oot (for "minimal
debhelper out-of-tree") which contains a debian/rules file which is
about 70 lines shorter than before, but builds identical packages:

* Identical lintian warnings including pedantic and experimental ones.
* No diff in dependencies.
* No diff in the file lists. (Exceptions: debug symbol files which
  always have the build id in their path name.)
* Nearly the same package sizes. (Interestingly the new packages are
  all slightly smaller. Not sure where that comes from or if it means
  that I missed something.)

Here's the debdiff with build-id related changes filtered out:

  ~/zsh/zsh → debdiff ../zsh_5.4.2-{2,3}_amd64.changes | fgrep -vi build-id
  [The following lists of changes regard files as different if they have
  different names, permissions or owners.]
  
  Files in second .changes but not in first
  -----------------------------------------
  
  Files in first .changes but not in second
  -----------------------------------------
  
  Control files of package zsh: lines which differ (wdiff format)
  ---------------------------------------------------------------
  Depends: zsh-common (= [-5.4.2-2),-] {+5.4.2-3),+} libc6 (>= 2.15), libcap2 (>= 1:2.10), libtinfo5 (>= 6)
  Version: [-5.4.2-2-] {+5.4.2-3+}
  
  Control files of package zsh-common: lines which differ (wdiff format)
  ----------------------------------------------------------------------
  Installed-Size: [-12972-] {+12875+}
  Version: [-5.4.2-2-] {+5.4.2-3+}
  
  Control files of package zsh-dbgsym: lines which differ (wdiff format)
  ----------------------------------------------------------------------
  Depends: zsh (= [-5.4.2-2)-] {+5.4.2-3)+}
  Installed-Size: [-2563-] {+2562+}
  Version: [-5.4.2-2-] {+5.4.2-3+}
  
  Control files of package zsh-dev: lines which differ (wdiff format)
  -------------------------------------------------------------------
  Depends: zsh-common (= [-5.4.2-2)-] {+5.4.2-3)+}
  Version: [-5.4.2-2-] {+5.4.2-3+}
  
  Control files of package zsh-doc: lines which differ (wdiff format)
  -------------------------------------------------------------------
  Depends: zsh-common (= [-5.4.2-2)-] {+5.4.2-3)+}
  Installed-Size: [-5540-] {+5524+}
  Version: [-5.4.2-2-] {+5.4.2-3+}
  
  Control files of package zsh-static: lines which differ (wdiff format)
  ----------------------------------------------------------------------
  Version: [-5.4.2-2-] {+5.4.2-3+}
  
  Control files of package zsh-static-dbgsym: lines which differ (wdiff format)
  -----------------------------------------------------------------------------
  Depends: zsh-static (= [-5.4.2-2)-] {+5.4.2-3)+}
  Version: [-5.4.2-2-] {+5.4.2-3+}

Since jenkins currently has issues with autopkgtests (program names
have changed) and it's difficult to see if at least the build
passed(*), I plan to do an upload to Debian Experimental with that
debian/rules file.

(*) It built fine, go to the end of
    http://jenkins.grml.org/job/zsh-binaries/architecture=amd64/300/console
    and look for either the timestamp 07:34:46 or the line
    "dpkg-buildpackage: info: full upload (original source is
    included)"


The other thing which recently came up (again) is
https://bugs.launchpad.net/ubuntu/+source/zsh/+bug/1637220 ("zsh has
no /snap/bin in PATH") and
https://bugs.launchpad.net/ubuntu/+source/zsh/+bug/1640514 ("/snap/bin
is not added to the PATH when using zsh")

Of course I won't add such featherbrained path anywhere to Debian's
zsh package, but implementing an equivalent to bash and dash's
/etc/profile.d/ directory, maybe at /etc/zsh/zprofile.d/, should
suffice so that Ubuntu can implemented that in their snap, click or
whatever non-deb packages. (I do see some general gain for other
packages, too, otherwise I'd say Ubuntu should implement this in their
zsh package — which always differs from Debian as they take upstream
tar balls with the pre-built documentation including wrong paths.)

We can probably just take the implementation from Debian's default
/etc/profile, slightly optimised (as we don't have to care about
/bin/sh) and adapted for zsh.

Excerpt from original Debian /etc/profile:

  if [ -d /etc/profile.d ]; then
    for i in /etc/profile.d/*.sh; do
      if [ -r $i ]; then
        . $i
      fi
    done
    unset i
  fi

So my current idea is to add this to /etc/zsh/zprofile (untested):

  if [[ -d /etc/zsh/zprofile.d ]]; then
    for i in /etc/zsh/zprofile.d/*.zsh; do
      if [[ -r "${i}" ]]; then
        . "${i}"
      fi
    done
    unset i
  fi

Then again, we already fiddle with the path in /etc/zsh/zshenv… But I
think that adding a mean to change _any_ zsh invocation (even
non-interactive, non-login ones) for arbitrary packages is rather
scary and dangerous. Only doing so for login shells seems sufficient
and safe enough (as effects are probably noticed quickly).

Opinions? Improvement suggestions? Objections?

		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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-zsh-devel/attachments/20171112/d3c66be6/attachment.sig>


More information about the Pkg-zsh-devel mailing list