replaced lsb_release with os-release file
Some checks failed
Codacy Scan / Codacy Security Scan (push) Successful in 1m4s
Build WHY2-chat / test-why2 (./out/why2-chat-client, ./configure.sh, ubuntu-latest, ./out/why2-chat-server) (push) Has been cancelled
Test WHY2-core / test-why2 (why2, ./configure.sh, gdb -ex "run" -ex "quit" --batch, ubuntu-latest, ./out/why2-core-test, valgrind --leak-check=full --show-leak-kinds=reachable --track-origins=yes -s) (push) Has been cancelled
Test WHY2-logger / test-why2 (why2-logger, ./configure.sh, gdb -ex "run" -ex "quit" --batch, ubuntu-latest, ./out/why2-logger-test, valgrind --leak-check=full --show-leak-kinds=reachable --track-origins=yes -s) (push) Has been cancelled
Test Project / test-project (./configure.sh, gdb -ex "run" -ex "quit" --batch, ubuntu-latest, ./test) (push) Has been cancelled
Some checks failed
Codacy Scan / Codacy Security Scan (push) Successful in 1m4s
Build WHY2-chat / test-why2 (./out/why2-chat-client, ./configure.sh, ubuntu-latest, ./out/why2-chat-server) (push) Has been cancelled
Test WHY2-core / test-why2 (why2, ./configure.sh, gdb -ex "run" -ex "quit" --batch, ubuntu-latest, ./out/why2-core-test, valgrind --leak-check=full --show-leak-kinds=reachable --track-origins=yes -s) (push) Has been cancelled
Test WHY2-logger / test-why2 (why2-logger, ./configure.sh, gdb -ex "run" -ex "quit" --batch, ubuntu-latest, ./out/why2-logger-test, valgrind --leak-check=full --show-leak-kinds=reachable --track-origins=yes -s) (push) Has been cancelled
Test Project / test-project (./configure.sh, gdb -ex "run" -ex "quit" --batch, ubuntu-latest, ./test) (push) Has been cancelled
also supporting X-based distributions
This commit is contained in:
parent
17a73d9157
commit
61d2d8069c
23
configure.sh
23
configure.sh
@ -17,9 +17,16 @@
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
# Get linux distro
|
||||
DISTRO=$(lsb_release -is)
|
||||
DISTRO=$(grep ^ID_LIKE= /etc/os-release | cut -d= -f2 | tr -d '"')
|
||||
if [ -e $DISTRO ]
|
||||
then
|
||||
DISTRO=$(grep ^ID= /etc/os-release | cut -d= -f2 | tr -d '"')
|
||||
fi
|
||||
echo $DISTRO
|
||||
exit
|
||||
|
||||
if [[ $(id -u) != "0" ]] && [[ $1 != "force" ]]; then
|
||||
if [[ $(id -u) != "0" ]] && [[ $1 != "force" ]]
|
||||
then
|
||||
echo "You must run this script as root! (To skip this, run with 'force' arg: \"./configure.sh force\")"
|
||||
exit 1
|
||||
fi
|
||||
@ -28,11 +35,14 @@ COMMON="gcc make tmux curl"
|
||||
ARCH_GENTOO_COMMON="$COMMON json-c libgit2 gmp openssl"
|
||||
|
||||
# Get COMMAND
|
||||
if [[ $DISTRO == "Arch" ]]; then
|
||||
if [[ $DISTRO == "arch" ]]
|
||||
then
|
||||
COMMAND="pacman -S --needed --noconfirm $ARCH_GENTOO_COMMON"
|
||||
elif [[ $DISTRO == "Ubuntu" ]] || [[ $DISTRO == "Debian" ]]; then
|
||||
elif [[ $DISTRO == "Ubuntu" ]] || [[ $DISTRO == "Debian" ]]
|
||||
then
|
||||
COMMAND="apt-get install -y $COMMON libjson-c-dev libcurl4-openssl-dev libgit2-dev libgmp-dev libssl-dev"
|
||||
elif [[ $DISTRO == "Gentoo" ]]; then
|
||||
elif [[ $DISTRO == "Gentoo" ]]
|
||||
then
|
||||
COMMAND="emerge -vn $ARCH_GENTOO_COMMON"
|
||||
|
||||
# Add
|
||||
@ -60,7 +70,8 @@ fi
|
||||
$COMMAND
|
||||
|
||||
# Install Rust
|
||||
if ! [ -x "$(command -v cargo)" ]; then
|
||||
if ! [ -x "$(command -v cargo)" ]
|
||||
then
|
||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y # Install Rust and components
|
||||
source "$HOME/.cargo/env"
|
||||
fi
|
Loading…
x
Reference in New Issue
Block a user