]> code.ossystems Code Review - openembedded-core.git/commitdiff
oe-git-proxy: allow setting SOCAT from outside
authorHenning Schild <henning.schild@siemens.com>
Tue, 3 Sep 2019 13:43:45 +0000 (15:43 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sun, 15 Sep 2019 16:49:47 +0000 (17:49 +0100)
This allows to write selftests where we can mock the real socat.

Signed-off-by: Henning Schild <henning.schild@siemens.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
scripts/oe-git-proxy

index bb2ed2a46e45deef0f67a4f54014d8cf659ab333..8499a99a71f11f6e192af5a82b46aae0889cd0ee 100755 (executable)
@@ -41,10 +41,12 @@ if [ $# -lt 2 -o "$1" = '--help' -o "$1" = '-h' ] ; then
 fi
 
 # Locate the netcat binary
-SOCAT=$(which socat 2>/dev/null)
-if [ $? -ne 0 ]; then
-       echo "ERROR: socat binary not in PATH" 1>&2
-       exit 1
+if [ -z "$SOCAT" ]; then
+       SOCAT=$(which socat 2>/dev/null)
+       if [ $? -ne 0 ]; then
+               echo "ERROR: socat binary not in PATH" 1>&2
+               exit 1
+       fi
 fi
 METHOD=""