post_install() {
  rm -f /usr/bin/deli
  ln -sf delicate /usr/bin/deli
  sed 's:deli.tavvva.net\/0.8.0:delicate-linux.net\/0.1:g' -i /etc/pacman.conf
  mv -f /etc/issue.new /etc/issue
  sed 's:/usr/bin/setfont $FONT:/usr/bin/setfont  $FONT\n    /usr/bin/setfont -C /dev/tty2\n    /usr/bin/setfont -C /dev/tty3\n    /usr/bin/setfont -C /dev/tty4\n    /usr/bin/setfont -C /dev/tty5\n    /usr/bin/setfont -C /dev/tty6:g' -i /etc/rc
  cat /etc/rc | grep -v "/usr/bin/setfont  $FONT" > /etc/rc.tmp-update
  mv -f /etc/rc.tmp-update /etc/rc
  chmod +x /etc/rc
  sed 's:    /usr/bin/setfont -C /dev/tty6:    /usr/bin/setfont -C /dev/tty6\n    /usr/bin/setfont  $FONT:g' -i /etc/rc

  sed 's|/usr/bin/less|/bin/less|g' -i /etc/profile

  mkdir -p /etc/profile.d
  if [ ! -f /etc/profile.d/unicode.sh ]; then
    grep '^export LANG=' < /etc/profile > /etc/profile.d/unicode.sh
    echo 'FONT=`. /etc/rc.conf &>/dev/null ; echo $FONT`' >> /etc/profile.d/unicode.sh
    echo 'unicode_start $FONT' >> /etc/profile.d/unicode.sh
    grep -v '^unicode_start' < /etc/profile | grep -v '^FONT=' | grep -v '^export LANG=' > /etc/profile.unicode-tmp
    mv -f /etc/profile.unicode-tmp /etc/profile
  fi

  grep '# process profile.d directory' < /etc/profile &>/dev/null
  if [ $? != 0 ]; then
  cat >> /etc/profile << EOF

# process profile.d directory
if [ -d /etc/profile.d ]; then
  for i in /etc/profile.d/*.sh; do
    if [ -r \$i ]; then
      . \$i
    fi
  done
  unset i
fi
EOF
  fi
}

post_upgrade() {
  post_install $1
}

op=$1
shift
$op $*
