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 / gsfonts-x11.preinst < prev    next >
Encoding:
Text File  |  2006-10-09  |  1.7 KB  |  64 lines

  1. #! /bin/sh
  2. #
  3. #   $Id: preinst,v 1.3 2000-01-08 22:32:05 roland Exp $
  4. #
  5. #   Copyright (c) 2000 Roland Rosenfeld <roland@spinnaker.de>
  6. #
  7. #   This program is free software; you can redistribute it and/or
  8. #   modify it under the terms of the GNU General Public License as
  9. #   published by the Free Software Foundation; either version 2 of
  10. #   the License, or (at your option) any later version.
  11. #
  12. #   This program is distributed in the hope that it will be useful,
  13. #   but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. #   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. #   General Public License for more details.
  16. #
  17. #   You should have received a copy of the GNU General Public License
  18. #   along with this program; if not, write to the Free Software
  19. #   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  20. #
  21. ##########################################################################
  22.  
  23. set -e
  24.  
  25.  
  26.  
  27. remove_old_fontpath() {
  28.     XF86CONFIG=/etc/X11/XF86Config
  29.     GSFONTS=/usr/lib/ghostscript/fonts
  30.  
  31.     # No XF86Config found?:
  32.     [ -f $XF86CONFIG ] || return 0
  33.  
  34.     if ! grep -q "$GSFONTS" $XF86CONFIG
  35.     then
  36.     # ghostscript fonts not in XF86Config, so don't do anything else here.
  37.     return 0
  38.     fi
  39.  
  40.     if [ -L $XF86CONFIG ]
  41.     then
  42.     # XF86Config is a symlink, so don't edit it:
  43.     echo "gsfonts-x11: $XF86CONFIG is a symbolic link, please manually"
  44.     echo "              remove $GSFONTS from your font path."
  45.     return 0
  46.     fi
  47.  
  48.     # Really remove $GSFONTS from font path:
  49.     grep -v "^[     ]*FontPath[     ]*\"$GSFONTS/\"" \
  50.         < $XF86CONFIG > $XF86CONFIG.nogsfonts-x11
  51.     mv $XF86CONFIG.nogsfonts-x11 $XF86CONFIG
  52. }
  53.  
  54. case "$1" in
  55.     upgrade)
  56.     if dpkg --compare-versions $2 le 0.7
  57.     then
  58.         remove_old_fontpath;
  59.     fi
  60.     ;;
  61. esac
  62.  
  63. exit 0
  64.