Re: [Bug 111654] texlive-base-bin uninstallable: md5sums unknown
Norbert Preining <preining@logic.at> wrote:
> This is not surprising: From the preinst code:
I didn't look at the full code (need to start preparing dinner for a
hungry wife), but from what you cite I don't understand the problem.
> 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 ...
If this file doesn't exist, the test in check_move will fail (-r $orig),
and consequently dpkg_md5sum shouldn't be called at all. How is it
possible that the file is actually there, but not as a conffile?
> 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
It doesn't hurt to do it that way. And it's safer, in case it's not a
single user's misconfiguration, but some special (ubuntu?) version which
put the file there as a non-conffile.
Regards, Frank
--
Dr. Frank Küster
Single Molecule Spectroscopy, Protein Folding @ Inst. f. Biochemie, Univ. Zürich
Debian Developer (teTeX/TeXLive)
Reply to: