From ca0349994da56b6823fa68d90a5af2c2fc4397a4 Mon Sep 17 00:00:00 2001 From: Christopher Roy Bratusek Date: Sun, 3 Jul 2016 20:07:55 +0200 Subject: [PATCH] when running patchimage from git, use it's tools, scripts and stuff, instead of system-wide installed --- patchimage.sh | 25 ++++++++++++------------- script.d/common.sh | 7 ++++--- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/patchimage.sh b/patchimage.sh index e72e33c..659b4c7 100755 --- a/patchimage.sh +++ b/patchimage.sh @@ -6,25 +6,24 @@ # # License: GPL v3 -if [[ -d ${PWD}/script.d ]]; then - PATCHIMAGE_SCRIPT_DIR=${PWD}/script.d - PATCHIMAGE_PATCH_DIR=${PWD}/patches - PATCHIMAGE_TOOLS_DIR=${PWD}/tools +basedir=$(readlink -m "${BASH_SOURCE[0]}") +basedir=$(dirname ${basedir}) + +if [[ -d ${basedir}/script.d ]]; then + PATCHIMAGE_SCRIPT_DIR=${basedir}/script.d + PATCHIMAGE_PATCH_DIR=${basedir}/patches + PATCHIMAGE_TOOLS_DIR=${basedir}/tools else PATCHIMAGE_SCRIPT_DIR=/usr/share/patchimage/script.d PATCHIMAGE_PATCH_DIR=/usr/share/patchimage/patches PATCHIMAGE_TOOLS_DIR=/usr/share/patchimage/tools fi -PATCHIMAGE_RIIVOLUTION_DIR=${PWD} -PATCHIMAGE_WBFS_DIR=${PWD} -PATCHIMAGE_AUDIO_DIR=${PWD} -PATCHIMAGE_GAME_DIR=${PWD} -PATCHIMAGE_COVER_DIR=${PWD} - -if [[ -e $HOME/.patchimage.rc ]]; then - source $HOME/.patchimage.rc -fi +PATCHIMAGE_RIIVOLUTION_DIR=${basedir} +PATCHIMAGE_WBFS_DIR=${basedir} +PATCHIMAGE_AUDIO_DIR=${basedir} +PATCHIMAGE_GAME_DIR=${basedir} +PATCHIMAGE_COVER_DIR=${basedir} source ${PATCHIMAGE_SCRIPT_DIR}/common.sh optparse "${@}" diff --git a/script.d/common.sh b/script.d/common.sh index 3d4112f..23a295d 100644 --- a/script.d/common.sh +++ b/script.d/common.sh @@ -1,14 +1,15 @@ #!/bin/bash -PATCHIMAGE_VERSION=6.2.1 +PATCHIMAGE_VERSION=6.3.0 PATCHIMAGE_RELEASE=2016-07-03 +[[ -e $HOME/.patchimage.rc ]] && source $HOME/.patchimage.rc + setup_tools () { if [[ $(uname -m) == "x86_64" ]]; then SUFFIX=64 - else - SUFFIX=32 + else SUFFIX=32 fi WIT=${PATCHIMAGE_TOOLS_DIR}/wit.${SUFFIX}