[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [slocate] failed to remove diversion

[Cc'd to debian-devel for sanity checking, and the release manager as
this relates to (and, I believe, finally closes) multiple
release-critical bugs.]

Andrew Pimlott wrote:
> I think this is distict from the other diversion bug(s):
> Preparing to replace slocate 2.0-1 (using .../slocate_2.1-3_i386.deb)
> ...
> No diversion `diversion of /usr/bin/locate to /usr/bin/locate.old by
> slocate', none removed
> No diversion `diversion of /usr/bin/updatedb to /usr/bin/updatedb.old
> by slocate', none removed
> Removing `diversion of /usr/man/man1/locate.1.gz to
> /usr/man/man1/locate.1.gz.old by slocate'
> dpkg-divert: rename involves overwriting `/usr/man/man1/locate.1.gz'
> with different file `/usr/man/man1/locate.1.gz.old', not allowed

I agree with the changelog that this particular incarnation of the
diversions mess in slocate is fixed in 2.1-4. However, it's still broken
on my system:

# Preparing to replace slocate 2.1-3 (using .../slocate_2.1-4_i386.deb)
# ...
# ===============================================
# ===Error. The following diversions still exist:
# diversion of /usr/share/man/man1/locate.1.gz to
# /usr/share/man/man1/locate.1.gz.old by slocate
# diversion of /usr/share/man/man1/updatedb.1.gz to
# /usr/share/man/man1/updatedb.1.gz.old by slocate
# ===============================================
# dpkg: error processing /var/cache/apt/archives/slocate_2.1-4_i386.deb
# (--unpack):
#  subprocess pre-installation script returned error exit status 1

I feel rather responsible for this one, as it was my
"slocate makes unhelpful diversions" bug that prompted this mess in the
first place, so I think I ought to fix it.

For debian-devel's benefit in the way of background, slocate used to
dpkg-divert findutils' manpages to locate.1.gz.old and
updatedb.1.gz.old. I asked if these could be moved to locate.old.1.gz
and updatedb.old.1.gz instead, so that they could still be accessible
with man if need be [1]. This evidently caused some confusion, and to
make matters worse it's interacted badly with the move from /usr/man to

As far as I can tell, the maintainer's simply missed out one of the
locations to which those manpages have been diverted in the past (and
where it lived on my system). The following patch fixes this (for me, at

--- slocate-2.1/debian/preinst.orig	Wed Mar  1 03:57:59 2000
+++ slocate-2.1/debian/preinst	Wed Mar  1 03:48:14 2000
@@ -37,6 +37,12 @@
 			$DEBUG rm /usr/share/man/man1/updatedb.1.gz
+		if [ -f /usr/share/man/man1/updatedb.1.gz.old ]
+		then
+		$DEBUG dpkg-divert --package slocate --remove --rename \
+			--divert /usr/share/man/man1/updatedb.1.gz.old \
+			/usr/share/man/man1/updatedb.1.gz
+		fi
 		if [ -f /usr/share/man/man1/updatedb.$suffix.1.gz ]
 		$DEBUG dpkg-divert --package slocate --remove --rename \
@@ -82,6 +88,12 @@
 		if [ -f /usr/share/man/man1/locate.1.gz ]
 			$DEBUG rm /usr/share/man/man1/locate.1.gz
+		fi
+		if [ -f /usr/share/man/man1/locate.1.gz.old ]
+		then
+		$DEBUG dpkg-divert --package slocate --remove --rename \
+			--divert /usr/share/man/man1/locate.1.gz.old \
+			/usr/share/man/man1/locate.1.gz
 		if [ -f /usr/share/man/man1/locate.$suffix.1.gz ]

Sorry for all the confusion caused; if I have time, I'll see if I can
work out how to simplify the preinst, which should help matters somewhat
as the situation really is rather complicated at the moment. However, I
believe that all outstanding release-critical bugs against slocate are
now closed, which is fortunate as I think it's a useful package for

[1] This wasn't just pedantry; I was trying to answer somebody's query
    about old locate, and wanted to get at its manpages.

Colin Watson                                           [cjw44@cam.ac.uk]

Reply to: