# arg 1:  the new package version
post_install() {
  /bin/true
}

# arg 1:  the new package version
# arg 2:  the old package version
post_upgrade() {
  if [ ! -d var/lib/pacman/local ]; then
    echo "==> Converting database..." >&2
    mkdir -p var/lib/pacman/local && usr/bin/convertdb var/lib/pacman/local
    echo "==> Done." >&2
  fi
  verchk=`vercmp ${2%-*} 2.8`
  if [ $verchk -lt 0 ]; then
    echo "---------------------------------------------------------------------"
    echo "NOTE: The Server URIs have changed in the default /etc/pacman.conf."
    echo "      Please look at /etc/pacman.conf.pacnew (if it exists) and "
    echo "      adjust your Server lines accordingly."
    echo
    echo "For example:"
    echo "    Server = ftp://ftp.archlinux.org/current"
    echo "will become:"
    echo "    Server = ftp://ftp.archlinux.org/current/os/i686"
    echo "---------------------------------------------------------------------"
  fi
if [ "`uname -m`" = "x86_64" ]; then
   cat << _EOF
  ==> 
  ==> 
  ==> ATTENTION x86_64 USERS:
  ==>
  ==> www.Arch64.org has gone offline!
  ==> 
  ==> point your repositories now to www.archlinux.org or its mirrors
  ==> 
  ==> check your old /etc/pacman.conf vs. /etc/pacman.conf.pacnew
  ==> 
  ==> also make sure you use the right CHOST variable for pkg building
  ==> check new /etc/makepkg.conf(.pacnew)
_EOF
fi
}

# arg 1:  the old package version
pre_remove() {
  /bin/true
}

op=$1
shift

$op $*
