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

possible mass-bug filing on fc-cache-using packages



Hi folks,

I noticed the other day that there are quite a few packages like
ttf-bitstream-vera which do the following in
/var/lib/dpkg/info/ttf-bitstream-vera.postinst:

  if [ "$1" = configure -a -x /usr/bin/fc-cache ]
  then
    echo -n "Regenerating fonts cache... "
    HOME=/root fc-cache -f -v 1>/var/log/fontconfig.log 2>&1 || \
    (echo "failed; see /var/log/fontconfig.log for more information."; \
    exit 1)
    echo "done."
  fi

This is wrong. Using ()'s creates a subshell, and exit then only
exits the subshell, not the postinst (which I believe it's supposed
to do). The code either needs an "|| exit $?" appended, or {}'s
should be used. Compare

  sh -c '( echo foo; exit 1; ); echo bar' 
  sh -c '{ echo foo; exit 1; }; echo bar' 

The reason seems to be brainless cut-n-pasting.

I think this calls for a mass-bug filing on fc-cache-using packages,
severity minor. But instead of having everyone fix this, I wonder
why debhelper isn't taking care of this. Thoughts?

-- 
 .''`.   martin f. krafft <madduck@debian.org>
: :'  :  proud Debian developer, author, administrator, and user
`. `'`   http://people.debian.org/~madduck - http://debiansystem.info
  `-  Debian - when you have better things to do than fixing systems
 
"even a stopped clock gives the right time twice a day."
                                                            -- orbital

Attachment: digital_signature_gpg.asc
Description: Digital signature (see http://martin-krafft.net/gpg/)


Reply to: