1
0
mirror of https://github.com/PurpleI2P/i2pd-tools synced 2025-01-15 17:20:08 +00:00

LSB Release instead uname if we can

This commit is contained in:
wipedlifepotato 2023-07-31 22:18:34 +07:00
parent 74173a26b1
commit 114fd1cfe7

View File

@ -14,14 +14,55 @@ dependWin="mingw-w64-x86_64-boost \
mingw-w64-x86_64-zlib" mingw-w64-x86_64-zlib"
kernel=`uname -a` kernel=`uname -a`
function isLsbReleaseExists() {
if which lsb_release > /dev/null; # do whereis can be too?
then
return 0
else
return 1
fi
}
case "$kernel" in function anotherDistr(){
echo "Just install libboost and libopenssl dev packages on your pc";
return 0
}
function installDeb(){
sudo apt-get install $dependNix;
return 0
}
function installOnGentoo(){
sudo emerge --deep --newuse dev-libs/boost dev-libs/openssl;
return 0
}
function installOnWin() {
pacman -S $depenWin;
return 0
}
function doInstallDepencies() {
case "$1" in
*Ubuntu*|*Debian*) *Ubuntu*|*Debian*)
sudo apt install $dependNix;; installDeb
;;
*gentoo*) *gentoo*)
sudo emerge --deep --newuse dev-libs/boost dev-libs/openssl;; installOnGentoo
;;
*MINGW64*) *MINGW64*)
pacman -S $dependWin;; installOnWin
;;
*) *)
echo "Just install libboost and libopenssl dev packages on your pc";; anotherDistr
;;
esac esac
}
if isLsbReleaseExists ;
then
distr=`lsb_release -i`
doInstallDepencies "$distr"
else #
doInstallDepencies "$kernel"
fi