Skip to content

Commit

Permalink
Merge pull request chxuan#268 from ardinzh/master
Browse files Browse the repository at this point in the history
add for Gentoo support
  • Loading branch information
chxuan authored Jun 1, 2020
2 parents 380e9a4 + aae73be commit 90b80e7
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()
{
Expand Down Expand Up @@ -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()
{
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 90b80e7

Please sign in to comment.