Package: zutils
Version: 1.14-3
Severity: serious
User: helm...@debian.org
Usertags: dep17
Control: owner -1 !
X-Debbugs-Cc: hol...@debian.org, de...@lists.debian.org

Hi Daniel,

I am sorry to tell you that the brittle /usr-move mitigations broke
again. Holger made me aware of a bookworm to trixie upgrade failure. It
can easily be reproduced.

mmdebstrap bookworm /dev/null http://deb.debian.org/debian --include=zutils 
--chrooted-customize-hook='sed -i -e s/bookworm/trixie/ /etc/apt/sources.list 
&& apt-get update && apt-get -y install zutils

| dpkg: considering removing zutils in favour of gzip ...
| dpkg: yes, will remove zutils in favour of gzip
| (Reading database ... 10911 files and directories currently installed.)
| Preparing to unpack .../archives/gzip_1.13-1_amd64.deb ...
| Mitigating diversion of /bin/zcat on behalf of zutils
| Adding 'diversion of /usr/bin/zcat to /usr/bin/zcat.usr-is-merged by zutils'
| Mitigating diversion of /bin/zcmp on behalf of zutils
| Adding 'diversion of /usr/bin/zcmp to /usr/bin/zcmp.usr-is-merged by zutils'
| Mitigating diversion of /bin/zdiff on behalf of zutils
| Adding 'diversion of /usr/bin/zdiff to /usr/bin/zdiff.usr-is-merged by zutils'
| Mitigating diversion of /bin/zegrep on behalf of zutils
| Adding 'diversion of /usr/bin/zegrep to /usr/bin/zegrep.usr-is-merged by 
zutils'
| Mitigating diversion of /bin/zfgrep on behalf of zutils
| Adding 'diversion of /usr/bin/zfgrep to /usr/bin/zfgrep.usr-is-merged by 
zutils'
| Mitigating diversion of /bin/zgrep on behalf of zutils
| Adding 'diversion of /usr/bin/zgrep to /usr/bin/zgrep.usr-is-merged by zutils'
| Unpacking gzip (1.13-1) over (1.12-1) ...

apt opts for unpacking trixie's gzip before unpacking a new zutils.
That's fine.

| Removing zutils (1.12-2), to allow configuration of gzip (1.13-1) ...

apt observes that the upgraded gzip Conflicts with the installed zutils
and therefore removes it.

| Selecting previously unselected package zutils.
| Preparing to unpack .../zutils_1.14-3_amd64.deb ...

Rather than configuring gzip, it now heads to installing the upgraded
zutils.

| dpkg-divert: error: 'diversion of /usr/bin/zcat to /usr/bin/zcat.gzip by 
zutils' clashes with 'diversion of /usr/bin/zcat to /usr/bin/zcat.usr-is-merged 
by zutils'
| dpkg: error processing archive 
/var/cache/apt/archives/zutils_1.14-3_amd64.deb (--unpack):
|  new zutils package pre-installation script subprocess returned error exit 
status 2
| Errors were encountered while processing:
|  /var/cache/apt/archives/zutils_1.14-3_amd64.deb
| E: Sub-process /usr/bin/dpkg returned an error code (1)

zutils.preinst from trixie is faced with what looks like a fresh install
as /bin/zcat is not diverted, but gzip's diversion of /usr/bin/zcat
still exists, as gzip has not been configured.

My vague memory is that this used to work differently and note that apt
switched to the 3.0 solver fairly recently.

If apt were to actually configure gzip after removing zutils,
gzip.postinst would be removing the .usr-is-merged diversions and we
were not having this problem.

If apt were to upgrade zutils rather than removing and installing it,
the zutils.preinst script were noticing the old diversion and correctly
handling the protective diversions installed by gzip.

What it is not prepared to handle is being removed and then reinstalled
in that window between gzip being unpacked and configured where those
protective diversions exist.

I will provide a patch, but not immediately, because I've gotten this
wrong so many times already.

Helmut

Reply via email to