Bug#1290:
Some experimentation shows the following, there are two problems.
1. Man will only regenerate the catman page if it is older than the
man page. Dpkg(tar) preserves the dates of files when it installs then
so it is possible to install a new man page that is older than the old
catman file. The catman file is thus assumed to be uptodate and not
rebuilt.
2. Old catman files are left behind when a package is removed.
i.e.
Start with nothing root@tigger# man mt
No manual entry for mt
root@tigger# ls -l /usr/man/man1/mt.1 /var/catman/cat1/mt.1.gz
ls: /usr/man/man1/mt.1: No such file or directory
ls: /var/catman/cat1/mt.1.gz: No such file or directory
Install cpio pkg root@tigger# dpkg -i cpio-2.3-2.deb
Selecting previously deselected package cpio.
(Reading database ... 10683 files and directories currently installed.)
Unpacking cpio (from cpio-2.3-2.deb) ...
Setting up cpio ...
root@tigger# man mt
Updating index cache for path `/usr/man'. Wait...done.
See the correct Reformatting mt(1), please wait...
thing
<showes cpio mt man page>
This has built a root@tigger# ls -l /usr/man/man1/mt.1 var/catman/cat1/mt.1.gz
catman page -rw-r--r-- 1 root root 2808 Jan 6 1995 /usr/man/man1/mt.1
-rw-r--r-- 1 man root 1413 Sep 14 21:34 /var/catman/cat1/mt.1.gz
Install mt-st root@tigger# dpkg -i mt-st-0.2-3.deb
Selecting previously deselected package mt-st.
(Reading database ... 10688 files and directories currently installed.)
Unpacking mt-st (from mt-st-0.2-3.deb) ...
Setting up mt-st ...
<some setup text>
See the wrong thing root@tigger# man mt
<shows cpio mt man page>
because "new" man root@tigger# ls -l /usr/man/man1/mt.1 /var/catman/cat1/mt.1.gz
page is older than -rw-r--r-- 1 root root 3973 Sep 10 03:22 /usr/man/man1/mt.1
catman page so -rw-r--r-- 1 man root 1413 Sep 14 21:34 /var/catman/cat1/mt.1.gz
catman page not
rebuilt
Make man page newer tigger# touch /usr/man/man1/mt.1
root@tigger# ls -l /usr/man/man1/mt.1
-rw-r--r-- 1 root root 3973 Sep 14 21:36 /usr/man/man1/mt.1
Catman page is root@tigger# man mt
rebuilt Reformatting mt(1), please wait...
< shows mt-st mt man page>
Remove cpio and root@tigger# dpkg --purge mt-st
mt-st (Reading database ... 10689 files and directories currently installed.)
Removing mt-st ...
root@tigger# dpkg --purge cpio
(Reading database ... 10686 files and directories currently installed.)
Removing cpio ...
Catman page is root@tigger# ls -l /usr/man/man1/mt.1 /var/catman/cat1/mt.1.gz
left behind. ls: /usr/man/man1/mt.1: No such file or directory
-rw-r--r-- 1 man root 1854 Sep 14 21:36 /var/catman/cat1/mt.1.gz
Install cpio pkg root@tigger# dpkg -i cpio-2.3-2.deb
Selecting previously deselected package cpio.
(Reading database ... 10683 files and directories currently installed.)
Unpacking cpio (from cpio-2.3-2.deb) ...
Setting up cpio ...
root@tigger# ls -l /usr/man/man1/mt.1 var/catman/cat1/mt.1.gz
-rw-r--r-- 1 root root 2808 Jan 6 1995 /usr/man/man1/mt.1
-rw-r--r-- 1 man root 1854 Sep 14 21:36 /var/catman/cat1/mt.1.gz
See the wrong thing root@tigger# man mt
catman not rebuilt
because its newer <shows mt-st mt man page>
Bring man page root@tigger# touch /usr/man/man1/mt.1
up to date root@tigger# ls -l /usr/man/man1/mt.1 /var/catman/cat1/mt.1.gz
-rw-r--r-- 1 root root 2808 Sep 14 21:40 /usr/man/man1/mt.1
-rw-r--r-- 1 man root 1854 Sep 14 21:36 /var/catman/cat1/mt.1.gz
root@tigger# man mt
OK again Reformatting mt(1), please wait...
<showes cpio mt man page>
root@tigger# exit
What shall we do about this?
We could make dpkg set the time on installed files to the installation
rather than the archive time. This will ensure that any existing
catman pages are rebuilt after a package install. Im sure lots of
people like to see the creation (archive) dates rather than
installation dates on files though. Personally I dont care about
this. Normally people use these dates for version comparisons
etc. they could use md5sum, ls etc. instead.
What to do about stray catman pages left behind? They should be
deleted. dpkg knows when things are deinstall so this is probably the
best tool to remove then. Maybe a script to grep/sed/awk the .list
file to generate possibe catman name to delete. Maybe the scripts used
to delete old catman pages could also check for straycats and delete
them. (but not under the local hierachy?)
Hmmmmm :)
alvar (man pkg maintainer)
--
Alvar Bray
Mail: Meiko Limited Voice: +44 1454 616171
650 Aztec West Fax: +44 1454 618188
Bristol BS12 4SD E-Mail: alvar@meiko.co.uk
England WWW: http://www.meiko.com
Reply to: