Package: fontconfig
Version: 2.8.0-3

Hi,

debian/fontconfig.postinst includes this snippet:

  if dpkg --compare-versions "$2" lt 2.4.0-1; then
  printf "Cleaning up old fontconfig caches... "
  for dir in /usr/share/fonts /var/lib/defoma/fontconfig.d   
/usr/X11R6/lib/X11/fonts /usr/local/share/fonts ; do
        if [ -d $dir ]; then
            find $dir -name fonts.cache-1 -exec rm -f \{\} \;
            find $dir -depth -mindepth 1 -type d -exec rmdir 
--ignore-fail-on-non-empty \{\} \;
        fi
  done
  ...

Since this uses "lt" instead of "lt-nl" as the comparison operator, this block gets run when fontconfig is initially installed, as well as when upgrading from fontconfig (<< 2.4.0-1). While it's arguably fine to delete empty directories in the upgrade case, running it on install can cause problems if there are legitimately any empty directories.

In particular, Ubuntu's ttf-mscorefonts-installer package includes an empty /usr/share/fonts/truetype/msttcorefonts directory in the package, and writes files to that directory in the postinst. If you install fontconfig and ttf-mscorefonts-installer in the same apt run, the directory will get unpacked, fontconfig's postinst will rmdir it, and ttf-mscorefont-installer's postinst will get really confused.

fontconfig really should not be delete directories owned by other packages at all. But that's probably hard, and it shoulf suffice to just avoid this cleanup entirely in the new install case. This would be solved by using "lt-nl" instead of "lt", so that an empty $2 (a new install) causes dpkg --compare-versions to return false.

For more context, see
https://bugs.launchpad.net/ubuntu/+source/msttcorefonts/+bug/670629
comments 14 (which prompted packaging the empty directory) and 29
http://debathena.mit.edu/trac/ticket/975
comments "Pretty sure this is entirely different..." and "Anders and I found the bug..."

Thanks,
--
Geoffrey Thomas
geo...@mit.edu



--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to