I've looked into the situation with coreutils and dpkg fighting over textutils, and I think I have a better fixup than the one currently in sid. The resulting situation is better because: * It is simpler and more comprehensible, * There is no more insane diversionary code in dpkg, just a Pre-Depends. * Only a modicum of fixup code is needed in coreutils. * Future local diversions of md5sum.textutils set up by a system administrator will no longer be trashed during upgrades of coreutils. * During an upgrade from pre-diversionary versions, there will no longer ever be an instant during which md5sum doesn't exist.
Below you'll find my patches for dpkg and coreutils which I'm about to upload into Ubuntu Dapper right now. I think these same changes should be applied in sid's coreutils and dpkg. (I'm afraid that the patch to coreutils will reject due to me having backported one of the changes already made in sid, but the reject should be easy to fix up and I can provide a cleaner patch if that would be helpful.) History, as far as I can determine: dpkg 1.13.1 and earlier: contains /usr/bin/md5sum 1.13.2..9: does not contain md5sum; instead, diverts {text,core}utils's md5sum.textutils to md5sum but code to undivert it is broken 1.13.10: does not contain md5sum; instead, diverts {text,core}utils's md5sum.textutils to md5sum and undivert it on downgrade coreutils/textutils before 5.93-1: contains /usr/bin/md5sum.textutils (if anything) 5.93-1 onwards: contains md5sum and md5sum.textutils; preinst attempts unconditionally attempts to remove the diversion by dpkg (but before 5.94-1 is not always successful) New behaviours: dpkg: Pre-Depends on a version of textutils that provides md5sum Does not attempt to divert anything Relies on coreutils to undo diversions installed by older dpkg's coreutils: Provide both md5sum and md5sum.textutils Removes dpkg diversion when upgrading from older coreutils Regards, Ian.
diff -u coreutils-5.93/debian/changelog coreutils-5.93/debian/changelog --- coreutils-5.93/debian/changelog +++ coreutils-5.93/debian/changelog @@ -1,3 +1,14 @@ +coreutils (5.93-5ubuntu4) dapper; urgency=low + + * Only remove dpkg's mad md5sum diversion `once' (ie, on upgrade from + non-/usr/bin/md5sum-supplying corutils). This preserves any later + sysadmin-installed diversions of md5sum.textutils. + * Fix md5sum diversion problems with a hacksaw (Closes: #340119) + (change imported from Debian 5.94-1: some additional rm -f's to make + the diversion removal more aggressive^Wrobust). + + -- Ian Jackson <[EMAIL PROTECTED]> Fri, 5 May 2006 16:39:05 +0100 + coreutils (5.93-5ubuntu3) dapper; urgency=low * debian/patches/99a_fix_cp_manpage fix cp manpage formatting diff -u coreutils-5.93/debian/coreutils.preinst coreutils-5.93/debian/coreutils.preinst --- coreutils-5.93/debian/coreutils.preinst +++ coreutils-5.93/debian/coreutils.preinst @@ -18,8 +18,23 @@ done # work around stupid dpkg diversion of md5sum -dpkg-divert --remove /usr/share/man/man1/md5sum.textutils.1.gz -dpkg-divert --remove /usr/bin/md5sum.textutils +# Debian #340119, #289369, #313258; Ubuntu (Malone) #26886 +case "$2" in +'' | 4.* | 5.?.*) + # coreutils 5.93-1 onwards do this, so we can avoid doing + # it if we know it's already been done. That avoids trashing + # any real local diversion subsequently introduced by the sysadmin. + # (There are no coreutils versions between 5.2.1 and 5.93.) + rm -f /usr/bin/md5sum.textutils + rm -f /usr/share/man/man1/md5sum.textutils + dpkg-divert --remove /usr/share/man/man1/md5sum.textutils.1.gz + dpkg-divert --remove /usr/bin/md5sum.textutils + # Possibly this can be removed at some distant point, when we're + # sure that all of the systems infected with the diversion (ie, + # systems which were running the wrong version of sid, breezy or + # dapper) have been fixed. + ;; +esac #DEBHELPER#
diff -Nru /tmp/Eik4grQT1j/dpkg-1.13.11ubuntu5/debian/changelog /tmp/zWGLKCh7fx/dpkg-1.13.11ubuntu6/debian/changelog --- /tmp/Eik4grQT1j/dpkg-1.13.11ubuntu5/debian/changelog 2006-04-09 11:53:04.000000000 +0100 +++ /tmp/zWGLKCh7fx/dpkg-1.13.11ubuntu6/debian/changelog 2006-05-05 16:24:31.000000000 +0100 @@ -1,3 +1,11 @@ +dpkg (1.13.11ubuntu6) dapper; urgency=low + + * Completely remove md5sum diversion madness. Instead, we Pre-Depend + on a version of textutils which provides /usr/bin/md5sum. We rely on + the logic in coreutils to remove our diversions. + + -- Ian Jackson <[EMAIL PROTECTED]> Fri, 5 May 2006 16:24:23 +0100 + dpkg (1.13.11ubuntu5) dapper; urgency=low * Add new quiet option to dpkg-source to supress warnings. Patch applied diff -Nru /tmp/Eik4grQT1j/dpkg-1.13.11ubuntu5/debian/control /tmp/zWGLKCh7fx/dpkg-1.13.11ubuntu6/debian/control --- /tmp/Eik4grQT1j/dpkg-1.13.11ubuntu5/debian/control 2006-02-04 16:14:48.000000000 +0000 +++ /tmp/zWGLKCh7fx/dpkg-1.13.11ubuntu6/debian/control 2006-05-05 16:16:44.000000000 +0100 @@ -10,8 +10,7 @@ Package: dpkg Architecture: any Essential: yes -Pre-Depends: ${shlibs:Depends} -Depends: coreutils | textutils (>= 2.0-3) +Pre-Depends: ${shlibs:Depends}, coreutils (>= 5.93-1) Conflicts: sysvinit (<< 2.82-1), dpkg-iasearch (<< 0.11), dpkg-static, dpkg-dev (<< 1.10) Replaces: dpkg-doc-ja, dpkg-static, manpages-de (<= 0.4-3) Suggests: apt diff -Nru /tmp/Eik4grQT1j/dpkg-1.13.11ubuntu5/debian/dpkg.postinst /tmp/zWGLKCh7fx/dpkg-1.13.11ubuntu6/debian/dpkg.postinst --- /tmp/Eik4grQT1j/dpkg-1.13.11ubuntu5/debian/dpkg.postinst 2005-06-28 14:18:01.000000000 +0100 +++ /tmp/zWGLKCh7fx/dpkg-1.13.11ubuntu6/debian/dpkg.postinst 2006-05-05 16:16:42.000000000 +0100 @@ -137,18 +137,6 @@ } -# Divert textutils/coreutils md5sum now that we no longer provide it -divert_md5sum() { - if [ ! -f /usr/bin/md5sum ]; then - dpkg-divert --divert /usr/bin/md5sum --rename /usr/bin/md5sum.textutils - fi - if [ ! -f /usr/share/man/man1/md5sum.1.gz ]; then - dpkg-divert --divert /usr/share/man/man1/md5sum.1.gz --rename \ - /usr/share/man/man1/md5sum.textutils.1.gz - fi -} - - # Create log file and set default permissions if possible create_logfile() { logfile=/var/log/dpkg.log @@ -174,7 +162,6 @@ move_info_directory remove_info_symlink - divert_md5sum ;; abort-upgrade|abort-deconfigure|abort-remove) diff -Nru /tmp/Eik4grQT1j/dpkg-1.13.11ubuntu5/debian/dpkg.prerm /tmp/zWGLKCh7fx/dpkg-1.13.11ubuntu6/debian/dpkg.prerm --- /tmp/Eik4grQT1j/dpkg-1.13.11ubuntu5/debian/dpkg.prerm 2005-06-13 18:32:22.000000000 +0100 +++ /tmp/zWGLKCh7fx/dpkg-1.13.11ubuntu6/debian/dpkg.prerm 2006-05-05 16:16:44.000000000 +0100 @@ -17,31 +17,5 @@ # Before the package is replaced due to conflict: # <prerm> remove in-favour <new-package> <version> - -# Remove the md5sum diversion on removal or downgrade -undivert_md5sum() { - dpkg-divert --rename --remove /usr/bin/md5sum.textutils - dpkg-divert --rename --remove /usr/share/man/man1/md5sum.textutils.1.gz -} - - -case "$1" in - remove|upgrade) - case "$2" in - 0.* | 1.[0123456789].* | 1.10 | 1.10.* | 1.13.[01234] | '') - undivert_md5sum - ;; - esac - ;; - - failed-upgrade|deconfigure) - ;; - - *) - echo "$0 called with unknown argument \`$1'" 1>&2 - exit 1 - ;; -esac - #DEBHELPER# exit 0