post_install() {
  grep -qe '^/usr/bin/fish$' etc/shells || echo '/usr/bin/fish' >> etc/shells
}

post_upgrade() {
  post_install

  if [[ "$(vercmp $2 2.1.1)" -lt 0 ]]; then
    echo ":: With fish 2.1.1 release, the fishd socket has changed location due"
    echo "   to security concerns. To make fish pick up the changes, kill all"
    echo "   fishd processes."
  fi
}

pre_remove() {
  sed -ri '\|^/usr/bin/fish$|d' etc/shells
}

# vim:set ts=2 sw=2 et:
