Merge pull request #268 from ardinzh/master

add for Gentoo support
This commit is contained in:
chxuan 2020-06-01 20:49:26 +08:00 committed by GitHub
commit 90b80e7cf5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -27,6 +27,8 @@ function get_linux_distro()
echo "ArchLinux"
elif grep -Eq "ManjaroLinux" /etc/*-release; then
echo "ManjaroLinux"
elif grep -Eq "Gentoo" /etc/*-release; then
echo "Gentoo"
else
echo "Unknow"
fi
@ -318,6 +320,35 @@ function install_prepare_software_on_archlinux()
sudo ln -s /usr/lib/libtinfo.so.6 /usr/lib/libtinfo.so.5
}
# 安装gentoo必备软件
function install_prepare_software_on_gentoo()
{
test_install_gentoo app-editors/vim dev-util/ctags sys-devel/automake sys-devel/gcc dev-util/cmake sys-apps/ack dev-vcs/git media-libs/fontconfig
su - -c "ln -s /usr/lib/libtinfo.so.6 /usr/lib/libtinfo.so.5" -s /bin/bash
}
function test_install_gentoo()
{
pkgs=$*
pkg_need_install=""
for pkg in ${pkgs}
do
if qlist -I | grep -Eq $pkg; then
echo "$pkg is already installed."
else
pkg_need_install="$pkg_need_install $pkg"
fi
done
if sudo -l | grep -Eq "emerge"; then
sudo emerge -v $pkg_need_install
else
echo "Need Root password:"
su - -c "emerge -v $pkg_need_install" -s /bin/bash
fi
}
# 安装opensuse必备软件
function install_prepare_software_on_opensuse()
{
@ -521,6 +552,14 @@ function install_vimplus_on_archlinux()
begin_install_vimplus
}
# 在Gentoo上安装vimplus
function install_vimplus_on_gentoo()
{
backup_vimrc_and_vim
install_prepare_software_on_gentoo
begin_install_vimplus
}
# 在opensuse上安装vimplus
function install_vimplus_on_opensuse()
{
@ -559,6 +598,8 @@ function install_vimplus_on_linux()
install_vimplus_on_archlinux
elif [ ${distro} == "ManjaroLinux" ]; then
install_vimplus_on_archlinux
elif [ ${distro} == "Gentoo" ]; then
install_vimplus_on_gentoo
else
echo "Not support linux distro: "${distro}
fi