[projects/pld-builder.new] dynamic BUILDERPATH (relative to current script)

glen glen at pld-linux.org
Tue Oct 30 18:34:05 CET 2012


commit f38671dce98d4210fd60d13c5a12349c434572d2
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Tue Oct 30 19:33:59 2012 +0200

    dynamic BUILDERPATH (relative to current script)

 bin/file-sender.sh     | 5 ++++-
 bin/load-balancer.sh   | 5 ++++-
 bin/maintainer.sh      | 5 ++++-
 bin/request-fetcher.sh | 5 ++++-
 bin/request-handler.sh | 5 ++++-
 bin/rpm-builder.sh     | 5 ++++-
 bin/src-builder.sh     | 5 ++++-
 7 files changed, 28 insertions(+), 7 deletions(-)
---
diff --git a/bin/file-sender.sh b/bin/file-sender.sh
index 5babb4c..3bdfe10 100755
--- a/bin/file-sender.sh
+++ b/bin/file-sender.sh
@@ -5,7 +5,10 @@ export LC_CTYPE=en_US.iso-8859-1
 
 CONFIG=$HOME/.pldbuilderrc
 [ -f "$CONFIG" ] && . $CONFIG
-[ -n "$BUILDERPATH" ] || BUILDERPATH="$HOME/pld-builder.new/"
+if [ -z "$BUILDERPATH" ]; then
+	dir=$(dirname "$0")
+	BUILDERPATH="$(cd "$dir"/..; pwd)"
+fi
 export BUILDERPATH
 
 cd $BUILDERPATH
diff --git a/bin/load-balancer.sh b/bin/load-balancer.sh
index 055306a..25f4f1d 100755
--- a/bin/load-balancer.sh
+++ b/bin/load-balancer.sh
@@ -5,7 +5,10 @@ export LC_CTYPE=en_US.iso-8859-1
 
 CONFIG=$HOME/.pldbuilderrc
 [ -f "$CONFIG" ] && . $CONFIG
-[ -n "$BUILDERPATH" ] || BUILDERPATH="$HOME/pld-builder.new/"
+if [ -z "$BUILDERPATH" ]; then
+	dir=$(dirname "$0")
+	BUILDERPATH="$(cd "$dir"/..; pwd)"
+fi
 export BUILDERPATH
 
 cd $BUILDERPATH
diff --git a/bin/maintainer.sh b/bin/maintainer.sh
index e490b02..c97570e 100755
--- a/bin/maintainer.sh
+++ b/bin/maintainer.sh
@@ -5,7 +5,10 @@ export LC_CTYPE=en_US.iso-8859-1
 
 CONFIG=$HOME/.pldbuilderrc
 [ -f "$CONFIG" ] && . $CONFIG
-[ -n "$BUILDERPATH" ] || BUILDERPATH="$HOME/pld-builder.new/"
+if [ -z "$BUILDERPATH" ]; then
+	dir=$(dirname "$0")
+	BUILDERPATH="$(cd "$dir"/..; pwd)"
+fi
 export BUILDERPATH
 
 cd $BUILDERPATH
diff --git a/bin/request-fetcher.sh b/bin/request-fetcher.sh
index 1b446f7..d488c56 100755
--- a/bin/request-fetcher.sh
+++ b/bin/request-fetcher.sh
@@ -5,7 +5,10 @@ export LC_CTYPE=en_US.iso-8859-1
 
 CONFIG=$HOME/.pldbuilderrc
 [ -f "$CONFIG" ] && . $CONFIG
-[ -n "$BUILDERPATH" ] || BUILDERPATH="$HOME/pld-builder.new/"
+if [ -z "$BUILDERPATH" ]; then
+	dir=$(dirname "$0")
+	BUILDERPATH="$(cd "$dir"/..; pwd)"
+fi
 export BUILDERPATH
 
 cd $BUILDERPATH
diff --git a/bin/request-handler.sh b/bin/request-handler.sh
index 8c2ab85..466e94f 100755
--- a/bin/request-handler.sh
+++ b/bin/request-handler.sh
@@ -4,7 +4,10 @@ umask 022
 export LC_CTYPE=en_US.iso-8859-1
 CONFIG=$HOME/.pldbuilderrc
 [ -f "$CONFIG" ] && . $CONFIG
-[ -n "$BUILDERPATH" ] || BUILDERPATH="$HOME/pld-builder.new/"
+if [ -z "$BUILDERPATH" ]; then
+	dir=$(dirname "$0")
+	BUILDERPATH="$(cd "$dir"/..; pwd)"
+fi
 export BUILDERPATH
 
 if lockfile -r3 $HOME/.builder_request_handler.lock 2>/dev/null; then
diff --git a/bin/rpm-builder.sh b/bin/rpm-builder.sh
index 7e678e2..5fa235e 100755
--- a/bin/rpm-builder.sh
+++ b/bin/rpm-builder.sh
@@ -4,7 +4,10 @@ umask 022
 export LC_CTYPE=en_US.iso-8859-1
 CONFIG=$HOME/.pldbuilderrc
 [ -f "$CONFIG" ] && . $CONFIG
-[ -n "$BUILDERPATH" ] || BUILDERPATH="$HOME/pld-builder.new/"
+if [ -z "$BUILDERPATH" ]; then
+	dir=$(dirname "$0")
+	BUILDERPATH="$(cd "$dir"/..; pwd)"
+fi
 export BUILDERPATH
 
 cd $BUILDERPATH
diff --git a/bin/src-builder.sh b/bin/src-builder.sh
index c17e36b..a0d1a1a 100755
--- a/bin/src-builder.sh
+++ b/bin/src-builder.sh
@@ -4,7 +4,10 @@ umask 022
 export LC_CTYPE=en_US.iso-8859-1
 CONFIG=$HOME/.pldbuilderrc
 [ -f "$CONFIG" ] && . $CONFIG
-[ -n "$BUILDERPATH" ] || BUILDERPATH="$HOME/pld-builder.new/"
+if [ -z "$BUILDERPATH" ]; then
+	dir=$(dirname "$0")
+	BUILDERPATH="$(cd "$dir"/..; pwd)"
+fi
 export BUILDERPATH
 
 cd $BUILDERPATH
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/projects/pld-builder.new.git/commitdiff/f38671dce98d4210fd60d13c5a12349c434572d2



More information about the pld-cvs-commit mailing list