Package: zsh
Version: 5.0.7-3.1+b1
Severity: serious
Tags: patch
Justification: uninstallable
As noted on #747141, it is not safe for dh_installdocs --link-doc to
link together the documentation directories of an architecture-dependent
package and an architecture-independent package, because the resulting
lockstep dependency is unsatisfiable after the architecture-dependent
package receives a binNMU.
Here's a patch to fix that, using the approach that Axel Beckert
described on that bug:
> > - change the affected packages in question to not use --link-doc.
> That's likely the way I'd go with zsh then, with the addition of some
> additional symlinks from /usr/share/doc/zsh/something to
> /usr/share/doc/zsh-common/something for most files not being
> changelogs. *sigh*
I changed zsh-dbg from "docs linked to zsh-common" to "docs linked to zsh",
and installed the bare minimum of Policy-required docs in zsh.
zsh-dev is now self-contained (I don't think it's worth optimizing
its size).
I put the dpkg-maintscript glue to migrate /usr/share/doc/zsh from a
directory to a symlink in both zsh and zsh-common, because both packages
ship files in that directory now, and either package might be unpacked first.
Regards,
S
>From 9450b3c0ac7d7996a6cd4bab45e27fb24e5ec805 Mon Sep 17 00:00:00 2001
From: Simon McVittie <[email protected]>
Date: Mon, 10 Nov 2014 10:20:21 +0000
Subject: [PATCH] Be binNMU-safe: do not use dh_installdocs
--link-doc=zsh-common in architecture-dependent packages
---
debian/changelog | 10 ++++++++++
debian/rules | 22 +++++++++++++++++++---
debian/zsh-common.dirs | 1 +
debian/zsh-common.maintscript | 1 +
debian/zsh-dev.maintscript | 1 +
debian/zsh.maintscript | 1 +
6 files changed, 33 insertions(+), 3 deletions(-)
create mode 100644 debian/zsh-common.maintscript
create mode 100644 debian/zsh-dev.maintscript
create mode 100644 debian/zsh.maintscript
diff --git a/debian/changelog b/debian/changelog
index 6046a6f..c190bcb 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,13 @@
+zsh (5.0.7-3.1) UNRELEASED; urgency=medium
+
+ * Be binNMU-safe: do not use dh_installdocs --link-doc=zsh-common
+ in architecture-dependent packages
+ * Symlink zsh-common documentation files into /usr/share/doc/zsh
+ * Migrate /usr/share/doc/zsh and /usr/share/doc/zsh-dev from symlink
+ to directory using dpkg-maintscript-helper
+
+ -- Simon McVittie <[email protected]> Mon, 10 Nov 2014 08:21:42 +0000
+
zsh (5.0.7-3) unstable; urgency=low
* Upload to unstable again
diff --git a/debian/rules b/debian/rules
index c322e7c..7db7920 100755
--- a/debian/rules
+++ b/debian/rules
@@ -155,6 +155,15 @@ binary-indep: build-indep binary-arch-dynamic
dh_installchangelogs -pzsh-doc -pzsh-common
dh_lintian -i
dh_compress -i -Xpdf
+ set -e; cd debian/zsh-common/usr/share/doc/zsh-common; for x in *; do \
+ case "$$x" in \
+ (copyright|changelog.Debian.gz) \
+ ;; \
+ (*) \
+ ln -s ../zsh-common/$$x ../zsh/$$x; \
+ ;; \
+ esac; \
+ done
dh_fixperms -i
dh_installdeb -i
dh_md5sums -i
@@ -182,7 +191,12 @@ binary-arch-dynamic: build-arch
-dDepends debian/zsh/bin/* \
-dRecommends debian/zsh/usr/lib/*/zsh/*/zsh/*.so
- dh_installdocs -pzsh -pzsh-dbg --link-doc=zsh-common
+ dh_installdocs -pzsh -pzsh-dbg --link-doc=zsh
+ dh_installchangelogs -pzsh
+ # These are in zsh-common and there is no Policy reason why
+ # they can't be
+ rm -v -f debian/zsh/usr/share/doc/zsh/changelog
+ rm -v -f debian/zsh/usr/share/doc/zsh/NEWS.Debian
binary-arch-static: build-static
dh_testdir
@@ -192,7 +206,8 @@ binary-arch-static: build-static
# Do not symlink /usr/share/doc/zsh-static to
# /usr/share/doc/zsh-common because zsh-static has a unique,
- # generated README.Debian
+ # generated README.Debian, and because --link-doc between
+ # arch-dep and arch-indep packages breaks binNMUs
dh_installdocs -pzsh-static
awk 'BEGIN { print "The following modules are statically-compiled into the static zsh binary:\n"; } /link=static/ { printf "%s (%s %s)\n", substr($$1,6), $$4, $$5; }' obj-static/config.modules >debian/zsh-static/usr/share/doc/zsh-static/README.Debian
@@ -215,7 +230,8 @@ binary-arch-dev: build-arch
cd debian/zsh-dev/usr/share/aclocal; mv aczshoot.m4 zshoot.m4
- dh_installdocs -pzsh-dev --link-doc=zsh-common
+ dh_installdocs -pzsh-dev
+ dh_installchangelogs -pzsh-dev
binary-arch: binary-arch-dynamic binary-arch-static binary-arch-dev
dh_lintian -a
diff --git a/debian/zsh-common.dirs b/debian/zsh-common.dirs
index bf201bb..51addab 100644
--- a/debian/zsh-common.dirs
+++ b/debian/zsh-common.dirs
@@ -1,3 +1,4 @@
etc/zsh
+usr/share/doc/zsh
usr/share/man
usr/share/zsh/help
diff --git a/debian/zsh-common.maintscript b/debian/zsh-common.maintscript
new file mode 100644
index 0000000..93427a2
--- /dev/null
+++ b/debian/zsh-common.maintscript
@@ -0,0 +1 @@
+symlink_to_dir /usr/share/doc/zsh zsh-common 5.0.7-3
diff --git a/debian/zsh-dev.maintscript b/debian/zsh-dev.maintscript
new file mode 100644
index 0000000..c6e45a8
--- /dev/null
+++ b/debian/zsh-dev.maintscript
@@ -0,0 +1 @@
+symlink_to_dir /usr/share/doc/zsh-dev zsh-common 5.0.7-3
diff --git a/debian/zsh.maintscript b/debian/zsh.maintscript
new file mode 100644
index 0000000..93427a2
--- /dev/null
+++ b/debian/zsh.maintscript
@@ -0,0 +1 @@
+symlink_to_dir /usr/share/doc/zsh zsh-common 5.0.7-3
--
2.1.3