commit:     a05155c18b5f6a9ad3d191ae08c511a2746eccfa
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Wed Sep 10 19:58:54 2014 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Wed Sep 10 19:58:54 2014 +0000
URL:        
http://sources.gentoo.org/gitweb/?p=proj/releng.git;a=commit;h=a05155c1

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 4453009..ff596a7 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 a0cc15b..d7ea936 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 92a9380..33eee23 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}'`
 

Reply via email to