Skip to content
Permalink
Browse files

Update install-all

Outsource a lot of code to the update script
  • Loading branch information...
TotallyNotElite committed Sep 29, 2019
1 parent 2022330 commit 34fd3e3c966fbfbb488603b257585747d6b5bfa3
Showing with 8 additions and 31 deletions.
  1. +1 −1 README.md
  2. +5 −18 install-all
  3. +2 −12 scripts/dependencycheck
@@ -41,7 +41,7 @@ and a lot of useful features, including
## Automatic: (Ubuntu 17.10+/Arch based only)
Run in terminal:

* `wget -O - https://raw.githubusercontent.com/nullworks/One-in-all-cathook-install/master/install-all | bash`
* `bash <(wget -qO- https://raw.githubusercontent.com/nullworks/One-in-all-cathook-install/master/install-all)`

## Manual (Outdated):
You need CMake to build cathook, CMake should take care of dependencies
@@ -2,17 +2,10 @@

RUNUSER="sudo -u $LOGNAME"

#
# Install git in case this is a install-all only install
#
if [ -x "$(command -v pacman)" ]; then
sudo pacman -S --needed --noconfirm git
elif [ -x "$(command -v apt-get)" ]; then
sudo apt-get install -y git
else
echo -e "\033[1;31m\nCathook autoinstall is not supported on this system! Please install the following packages before continuing: Git, Boost + Headers, CMake, Gcc with 32 bit support, Gdb, 32 Bit SDL + Headers, 32 Bit Glew + Headers, 32 Bit Freetype 2 + Headers, Rsync, 32 Bit libglvnd\n\033[0m"
read -p "Press enter to continue or CTRL+C to cancel."
fi
set -e

# install all dependencies
./scripts/dependencycheck

#
# Update cathook
@@ -25,9 +18,6 @@ fi
$RUNUSER git fetch --force --depth 1 origin refs/tags/latest:refs/tags/latest && $RUNUSER git reset --hard latest # pull changes from github
$RUNUSER git submodule update --depth 1 --init --recursive # update/init submodules

# install all dependencies and allow non interactive install
./scripts/dependencycheck true

#
# Set config version for update script
#
@@ -38,7 +28,4 @@ $RUNUSER bash -c ". ./scripts/config.shlib; cfg_write ./scripts/updater-preferen
# Build cathook
#

$RUNUSER mkdir -p ./build; pushd build #create a directory for building cathook
$RUNUSER cmake ..;$RUNUSER make -j$(grep -c '^processor' /proc/cpuinfo) # create makefile and build using all available threads
sudo make data # create /opt/cathook/data
popd; cd ..
$RUNUSER ./update
@@ -3,12 +3,6 @@
arch_packages=(git boost cmake make gcc gdb lib32-sdl2 lib32-glew lib32-freetype2 rsync lib32-libglvnd dialog)
ubuntu_packages=(software-properties-common build-essential git g++ g++-multilib libboost-all-dev gdb libsdl2-dev:i386 libglew-dev:i386 libfreetype6-dev:i386 cmake dialog rsync)

if [ "$1" == true ]; then
allow_non_interactive=true
else
allow_non_interactive=false
fi

if [ -x "$(command -v pacman)" ]; then
pacman -Qi "${arch_packages[@]}" > /dev/null 2>&1
out=$?
@@ -26,8 +20,6 @@ if [ -x "$(command -v pacman)" ]; then
if [ "$out" != 0 ]; then
exit
fi
elif [ "$allow_non_interactive" == false ]; then
exit
fi
sudo pacman -S --noconfirm --needed "${arch_packages[@]}"
fi
@@ -48,15 +40,13 @@ elif [ -x "$(command -v apt-get)" ]; then
if [ "$out" != 0 ]; then
exit
fi
elif [ "$allow_non_interactive" == false ]; then
exit
fi
sudo apt-get update
sudo apt-get install -y software-properties-common
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
sudo dpkg --add-architecture i386
sudo apt update
sudo apt install -y "${ubuntu_packages[@]}"
sudo apt-get update
sudo apt.get install -y "${ubuntu_packages[@]}"
fi
else
echo -e "\033[1;33m\nWarning! Automatic package installation is not supported!\n\033[0m"

0 comments on commit 34fd3e3

Please sign in to comment.
You can’t perform that action at this time.