From 58aa0ada7d7f57a9cf7502a298e6a923ede79727 Mon Sep 17 00:00:00 2001 From: TotallyNotElite <1yourexperiment@protonmail.com> Date: Sun, 20 May 2018 21:17:14 +0200 Subject: [PATCH] Improve usability (updates and attach) --- install-all | 11 ++++++++++- tools/README | 1 + tools/attach | 4 ++++ tools/update | 23 +++++++++++++++++++++++ 4 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 tools/README create mode 100755 tools/attach create mode 100755 tools/update diff --git a/install-all b/install-all index b40437b8..500e24e8 100755 --- a/install-all +++ b/install-all @@ -8,6 +8,8 @@ sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && sudo apt update && sud # Install libglez # +mkdir cathook; cd cathook + git clone --recursive https://github.com/nullworks/libglez.git;cd libglez;mkdir build;cd build;cmake ..;make;sudo make install;cd ..;cd .. # @@ -26,4 +28,11 @@ git clone --recursive https://github.com/nullworks/simple-ipc.git;cd simple-ipc; # Build cathook # -git clone --recursive https://github.com/nullworks/cathook.git;cd cathook;mkdir build;cd build;cmake ..;make -j$(grep -c '^processor' /proc/cpuinfo); sudo make data +git clone --recursive https://github.com/nullworks/cathook.git;cd cathook;mkdir build;cd build;cmake ..;make -j$(grep -c '^processor' /proc/cpuinfo); sudo make data; cd ..; cd .. + +# +# Do post installation stuff +# + +cp -a -u ./cathook/tools/. ./ +rm ./README diff --git a/tools/README b/tools/README new file mode 100644 index 00000000..b7037c9e --- /dev/null +++ b/tools/README @@ -0,0 +1 @@ +These files are not intended to be run from this folder. diff --git a/tools/attach b/tools/attach new file mode 100755 index 00000000..21deff49 --- /dev/null +++ b/tools/attach @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +cd cathook +sudo bash attach diff --git a/tools/update b/tools/update new file mode 100755 index 00000000..2c0ad074 --- /dev/null +++ b/tools/update @@ -0,0 +1,23 @@ +#!/usr/bin/env bash + +cd cathook + +update() +{ + git fetch >update.log + if ! git pull origin $(git rev-parse --abbrev-ref HEAD) >>update.log; then + $DIALOG --title "Error" --backtitle "Updating" --msgbox "An error occured while updating cathook, check update.log for details. It might have been caused by changes in local files - in that case try resetting local repo." 8 78 + exit + fi + if ! git submodule update --remote --recursive >>update.log; then + $DIALOG --title "Error" --backtitle "Updating" --msgbox "An error occured while updating cathook, check update.log for details. It might have been caused by changes in local files - in that case try resetting local repo." 8 78 + exit + fi +} + +update + +cd build; cmake ..; make; cd ..; cd .. + +cp -a -u ./cathook/tools/. ./; rm ./README +