From 5a6c59f252568353914cfda4e55ed9f4c0b09fa8 Mon Sep 17 00:00:00 2001 From: filux Date: Sun, 27 Aug 2017 22:29:16 +0200 Subject: [PATCH] added the basic support for macOS to the 'system_report' script --- .travis.yml | 4 +- source/tools/support/linux/system_report | 390 +++++++++++------------ 2 files changed, 181 insertions(+), 213 deletions(-) diff --git a/.travis.yml b/.travis.yml index ba8550d2..6a084b48 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,7 @@ matrix: include: - os: linux compiler: gcc - env: Tr_Compiler_Version="6" + env: Tr_Compiler_Version="7" # https://launchpad.net/~ubuntu-toolchain-r/+archive/ubuntu/test dist: trusty # broken compiler on 12.04 - os: linux @@ -16,7 +16,7 @@ matrix: dist: trusty - os: linux compiler: clang - env: Tr_Compiler_Version="3.9" + env: Tr_Compiler_Version="5.0" # http://apt.llvm.org/, compiler not newer than available on debian testing # https://packages.debian.org/search?suite=testing&keywords=clang- dist: trusty diff --git a/source/tools/support/linux/system_report b/source/tools/support/linux/system_report index ca781155..174b6de2 100755 --- a/source/tools/support/linux/system_report +++ b/source/tools/support/linux/system_report @@ -8,7 +8,7 @@ # ----------------------------------------------------------------------------- # # Written by Tom Reynolds -# Copyright (c) 2012-2016 Tom Reynolds, The MegaGlest Team, under GNU GPL v3.0 +# Copyright (c) 2012-2017 Tom Reynolds, The MegaGlest Team, under GNU GPL v3.0 # # ----------------------------------------------------------------------------- # @@ -29,137 +29,113 @@ # LANG=C -VERSION='0.3.4' -MYNAME=`basename $0` -DEFAULT_REPORT_FILENAME=system_report.log +VERSION='0.3.5' +MYNAME="$(basename "$0")" +DEFAULT_REPORT_FILENAME="system_report.log" +KERNEL="$(uname -s | tr '[A-Z]' '[a-z]')" +if [ "$KERNEL" = "darwin" ]; then Exec_1="MegaGlest.sh"; Exec_2="MegaGlest" + Default_location="/Applications/MegaGlest.app/Contents/MacOS" +else Exec_1="start_megaglest"; Exec_2="megaglest" + Default_location=~/"megaglest" +fi +if [ "$KERNEL" = "linux" ] || [ "$(echo "$(readlink -f "$0" >/dev/null 2>&1; echo $?)" | grep '^[0-9]$')" -eq "0" ]; then + SCRIPTDIR="$(dirname "$(readlink -f "$0")")" +else + SCRIPTDIR="$(cd "$(dirname "$0")"; pwd)" +fi +if [ "$1" = "-v" ] || [ "$1" = "--version" ]; then + echo "MegaGlest System Report $VERSION"; echo; exit 0; fi -if [ "$1"'x' = '-vx' -o "$1"'x' = '--versionx' ] -then - echo 'MegaGlest System Report '"$VERSION" - echo '' - exit 0 +if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then + echo "Usage:" + echo " $MYNAME