Re: [Bug 111654] texlive-base-bin uninstallable: md5sums unknown
Hi all!
We have a problem here: When we fixed the xdvi.cfg conffile move
something is broken:
On Mit, 02 Mai 2007, Gongyi wrote:
> Preparing to replace texlive-base-bin 2005.dfsg.2-12ubuntu1 (using texlive-base-bin_2007-5ubuntu1_i386.deb) ...
> /etc/texmf/xdvi.cfg: md5sum not known. Exiting
> dpkg: error processing texlive-base-bin_2007-5ubuntu1_i386.deb (--install):
> subprocess pre-installation script returned error exit status 1
> cp: cannot stat `/etc/texmf/xdvi/xdvi.cfg': No such file or directory
> dpkg: error while cleaning up:
> subprocess post-removal script returned error exit status 1
> Errors were encountered while processing:
> texlive-base-bin_2007-5ubuntu1_i386.deb
This is not surprising: From the preinst code:
handle_config_file_preinst /etc/texmf/xdvi/xdvi.cfg $1 $2
-> handle_config_file_preinst:
/etc/texmf/xdvi/xdvi.cfg)
conf_oldpath="/etc/texmf/xdvi.cfg"
;;
esac
check_move $conf_oldpath $cfgfile $version
-> check_move
if [ -r "$orig" ] ; then
mdorig=$(dpkg_md5sum "$orig")
-> dpkg_md5sum
md5sum=$(grep "$file[[:space:]]" /var/lib/dpkg/status | cut -f 3 -d ' ')
if [ -z "$md5sum" ]; then
echo "$file: md5sum not known. Exiting" >&2
exit 1
Now of course this file didn't exist before ...
In fact this could happen with *all* the config files present in tetex
when it was never installed.
Examining check_move we should do:
Current version:
if [ -r "$orig" ] ; then
mdorig=$(dpkg_md5sum "$orig")
if [ $(md5sum "$orig" | cut -f 1 -d ' ') = "$mdorig" ] ; then
rm "$orig"
else
mkdir -p $(dirname "$new")
mv "$orig" "$new".preinst-copy
fi
In case the file is NOT present in the database it should ALSO be moved,
so I suggest that we change dpkg_md5sum to return an empty string
(no md5sum) in case the file is not present in the dpkg db.
Then the test will fail and it will be moved to .preinst-copy.
Do you agree? Or do I miss something?
Best wishes
Norbert
-------------------------------------------------------------------------------
Dr. Norbert Preining <preining@logic.at> Università di Siena
Debian Developer <preining@debian.org> Debian TeX Group
gpg DSA: 0x09C5B094 fp: 14DF 2E6C 0307 BE6D AD76 A9C0 D2BF 4AA3 09C5 B094
-------------------------------------------------------------------------------
WEEM (n.)
The tools with which a dentist can inflict the greatest
pain. Formerly, which tool this was dependent upon the imagination and
skill of the individual dentist, though now, with technological
advances, weems can be bought specially.
--- Douglas Adams, The Meaning of Liff
Reply to: