From a05155c18b5f6a9ad3d191ae08c511a2746eccfa Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Wed, 10 Sep 2014 15:58:54 -0400 Subject: [PATCH] catalyst-auto: set up a default GITDIR for scripts Rather than hardcode system-specific paths, let catalyst-auto probe the current git dir based on its script name. --- tools/catalyst-auto | 2 ++ tools/catalyst-auto-s390.conf | 2 -- tools/catalyst-auto-s390x.conf | 2 -- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/tools/catalyst-auto b/tools/catalyst-auto index 44530091..ff596a7f 100755 --- a/tools/catalyst-auto +++ b/tools/catalyst-auto @@ -123,6 +123,8 @@ if [ -z "${config_file}" -o ! -e "${config_file}" ]; then exit 1 fi +# Probe the default gitdir from this script name. +GITDIR=$(dirname "$(dirname "$(realpath "$0")")") source ${config_file} TMPDIR=$(mktemp -d --tmpdir="${TMP_PATH:-/tmp}" catalyst-auto.XXXXXX) diff --git a/tools/catalyst-auto-s390.conf b/tools/catalyst-auto-s390.conf index a0cc15bb..d7ea9369 100644 --- a/tools/catalyst-auto-s390.conf +++ b/tools/catalyst-auto-s390.conf @@ -1,8 +1,6 @@ # This is the config file for the catalyst-auto script. It should be pretty # self-explanatory. -GITDIR=/root/releng/ - SPECS_DIR=${GITDIR}/releases/weekly/specs/s390/s390 SUBARCH=`grep subarch $SPECS_DIR/stage1.spec | awk '{print $2}'` diff --git a/tools/catalyst-auto-s390x.conf b/tools/catalyst-auto-s390x.conf index 92a9380c..33eee236 100644 --- a/tools/catalyst-auto-s390x.conf +++ b/tools/catalyst-auto-s390x.conf @@ -1,8 +1,6 @@ # This is the config file for the catalyst-auto script. It should be pretty # self-explanatory. -GITDIR=/root/releng/ - SPECS_DIR=${GITDIR}/releases/weekly/specs/s390/s390x SUBARCH=`grep subarch $SPECS_DIR/stage1.spec | awk '{print $2}'`