home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2007 September / PCWSEP07.iso / Software / Linux / Linux Mint 3.0 Light / LinuxMint-3.0-Light.iso / casper / filesystem.squashfs / var / lib / dpkg / info / ttf-opensymbol.postrm < prev    next >
Encoding:
Text File  |  2007-04-10  |  2.1 KB  |  84 lines

  1. #!/bin/sh
  2. # postrm script for ttf-opensymbol
  3.  
  4. THIS_PACKAGE=ttf-opensymbol
  5. THIS_SCRIPT=postrm
  6.  
  7. set -e
  8.  
  9. LIBSUFFIX=li
  10. # vim:set ai et sts=2 sw=2 tw=0:
  11.  
  12. # Query the terminal to establish a default number of columns to use for
  13. # displaying messages to the user.  This is used only as a fallback in the
  14. # event the COLUMNS variable is not set.  ($COLUMNS can react to SIGWINCH while
  15. # the script is running, and this cannot, only being calculated once.)
  16. DEFCOLUMNS=$(stty size 2> /dev/null | awk '{print $2}') || true
  17. if ! expr "$DEFCOLUMNS" : "[[:digit:]]\+$" > /dev/null 2>&1; then
  18.   DEFCOLUMNS=80
  19. fi
  20.  
  21. message() {
  22.     echo "$*" | fmt -t -w ${COLUMNS:-$DEFCOLUMNS} >&2
  23. }
  24.  
  25. # Prepare to move a conffile without triggering a dpkg question
  26. prep_rm_conffile() {
  27.     CONFFILE="$1"
  28.  
  29.     if [ -e "$CONFFILE" ]; then
  30.         md5sum="`md5sum \"$CONFFILE\" | sed -e \"s/ .*//\"`"
  31.         old_md5sum="`sed -n -e \"/^Conffiles:/,/^[^ ]/{\\\\' $CONFFILE'{s/.* //;p}}\" /var/lib/dpkg/status`"
  32.         if [ "$md5sum" = "$old_md5sum" ]; then
  33.             mv "$CONFFILE" "$CONFFILE.${THIS_PACKAGE}-tmp"
  34.         fi
  35.     fi
  36. }
  37.  
  38. rm_conffile_commit() {
  39.   CONFFILE="$1"
  40.  
  41.   if [ -e $CONFFILE.${THIS_PACKAGE}-tmp ]; then
  42.     rm $CONFFILE.${THIS_PACKAGE}-tmp
  43.   fi
  44. }
  45.  
  46. # Remove a no-longer used conffile
  47. rm_conffile() {
  48.     CONFFILE="$1"
  49.  
  50.     if [ -e "$CONFFILE" ]; then
  51.         md5sum="`md5sum \"$CONFFILE\" | sed -e \"s/ .*//\"`"
  52.         old_md5sum="`sed -n -e \"/^Conffiles:/,/^[^ ]/{\\\\' $CONFFILE'{s/.* //;p}}\" /var/lib/dpkg/status`"
  53.         if [ "$md5sum" != "$old_md5sum" ]; then
  54.             echo "Obsolete conffile $CONFFILE has been modified by you."
  55.             echo "Saving as $CONFFILE.dpkg-bak ..."
  56.             mv -f "$CONFFILE" "$CONFFILE".bak
  57.         else
  58.             echo "Removing obsolete conffile $CONFFILE ..."
  59.             rm -f "$CONFFILE"
  60.         fi
  61.     fi
  62. }
  63.  
  64. trap "message;\
  65.       message \"Received signal.  Aborting script $0.\";\
  66.       message;\
  67.       exit 1" 1 2 3 15
  68.  
  69. VER=
  70.  
  71.  
  72. if [ "$1" = "remove" ] && [ -x /usr/bin/fc-cache ]; then
  73.     echo "Updating fontconfig cache..."
  74.     fc-cache -fs
  75. fi
  76.  
  77. if [ "$1" = "purge" ]; then
  78.     rm -f /usr/share/fonts/truetype/openoffice/fonts.cache*
  79. fi
  80.  
  81.  
  82.  
  83. exit 0
  84.