warn_nopy3() {
	py3grep=`vim --version | grep "\+python3"`
    if [ ${#py3grep} -le 1 ]
    then
        echo "-----------------------------------------------------"
        echo -e "\e[1mWarning:\e[m"
        echo "Your vim install doesn't seem to support Python 3."
        echo "If that's the case you should install the python2 and python2-jedi packages."
        echo "-----------------------------------------------------"
    fi
}

update_helptags() {
    printf "Updating vim help tags..."
    vim -e -s -c "helptags /usr/share/vim/vimfiles/doc/" -c "quit"
    printf "done\n"
}

post_install() {
    update_helptags
    warn_nopy3
}

post_upgrade() {
    update_helptags
    warn_nopy3
}

post_remove() {
    update_helptags
}
