Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Sep 25th, 2012  |  syntax: None  |  size: 3.11 KB  |  views: 103  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. configs=('10-antialias.conf'
  2.          '10-hinting.conf'
  3.          '10-hinting-slight.conf'      
  4.          '11-lcd-filter-lcddefault.conf'
  5.          '20-fix-globaladvance.conf'
  6.          '20-unhint-small-vera.conf'
  7.          '25-ttf-arphic-uming-render.conf'
  8.          '30-cjk-aliases.conf'
  9.          '30-defoma.conf'
  10.          '30-metric-aliases.conf'
  11.          '30-urw-aliases.conf'
  12.          '35-ttf-arphic-uming-aliases.conf'
  13.          '40-nonlatin.conf'
  14.          '41-ttf-arphic-uming.conf'        
  15.          '45-latin.conf'
  16.          '49-sansserif.conf'
  17.          '50-user.conf'
  18.          '51-local.conf'         
  19.          '53-monospace-lcd-filter.conf'
  20.          '60-latin.conf'
  21.          '64-ttf-arphic-uming.conf'
  22.          '64-ttf-thai-tlwg.conf'
  23.          '65-fonts-persian.conf'
  24.          '65-nonlatin.conf'
  25.          '69-unifont.conf'
  26.          '80-delicious.conf'
  27.          '90-synthetic.conf'
  28.          '90-ttf-arphic-uming-embolden.conf'
  29.          '90-ttf-thai-tlwg-synthetic.conf')
  30.          
  31. post_install() {
  32.   echo -n "updating font cache... "
  33.   /sbin/ldconfig -r .
  34.   pushd /etc/fonts/conf.d > /dev/null
  35.   for config in "${configs[@]}"; do
  36.     ln -sf ../conf.avail/${config} .
  37.   done
  38.   popd > /dev/null
  39.   /usr/bin/fc-cache -f
  40.   echo "done."
  41. }
  42.  
  43. post_upgrade() {
  44.   rm -f /etc/fonts/conf.d/10-bitmaps.conf
  45.   cat << _EOF
  46.  
  47. ===> Important Fontconfig configuration change <===
  48.  
  49.   The way fontconfig is configured has been changed.
  50.   Configuration is done via /etc/fonts/conf.avail and conf.d.
  51.   Read /etc/fonts/conf.avail/README for more information.
  52.  
  53.   Configuration via /etc/fonts/local.conf is still possible,
  54.   but is no longer recommended for options available in conf.avail.
  55.  
  56. _EOF
  57.  
  58.   if [ `vercmp 2.4.1-1 $2` -gt 0 ]; then
  59.   # Upgrade from old version, place all symlinks. pre-symlink package version
  60.     echo -n "Linking configuration files... "
  61.     pushd /etc/fonts/conf.d > /dev/null
  62.     for config in "${configs[@]}"; do
  63.       ln -sf ../conf.avail/${config} .
  64.     done
  65.     popd > /dev/null
  66.     echo "done."
  67.   fi
  68.  
  69.   if [ `vercmp 2.6.0-6 $2` -gt 0 ]; then
  70.   # pre-2.6.0 versions have missing config
  71.     echo -n "Adding missing configuration files... "
  72.     pushd /etc/fonts/conf.d > /dev/null
  73.     ln -sf ../conf.avail/30-metric-aliases.conf .
  74.     ln -sf ../conf.avail/40-nonlatin.conf .
  75.     ln -sf ../conf.avail/45-latin.conf .
  76.     popd > /dev/null
  77.     echo "done."
  78.   fi
  79.  
  80.   # Remove dead links
  81.   echo -n "Removing outdated configuration files... "
  82.   for config in /etc/fonts/conf.d/*; do
  83.     if [ ! -f ${config} ]; then
  84.       rm -f ${config}
  85.     fi
  86.   done
  87.   echo "done."
  88.  
  89.   echo -n "updating font cache... "
  90.   /usr/bin/fc-cache -f
  91.   echo "done."
  92. }
  93.  
  94. pre_upgrade() {
  95.   # Link new config files not present on system yet
  96.   echo -n "Symlinking new configuration files... "
  97.   pushd /etc/fonts/conf.d > /dev/null
  98.   for config in "${configs[@]}"; do
  99.     if [ ! -f ../conf.avail/${config} ]; then
  100.       ln -sf ../conf.avail/${config} .
  101.     fi
  102.   done
  103.   popd > /dev/null
  104.   echo "done."
  105. }
  106.  
  107. post_remove() {
  108.   pushd /etc/fonts/conf.d > /dev/null
  109.   for config in "${configs[@]}"; do
  110.     rm -f ${config}
  111.   done
  112.   popd > /dev/null
  113. }
clone this paste RAW Paste Data