]> code.ossystems Code Review - openembedded-core.git/commitdiff
oe-git-proxy: Correct the parsing of a port in $ALL_PROXY
authorPeter Kjellerstedt <peter.kjellerstedt@axis.com>
Fri, 18 Sep 2015 10:46:05 +0000 (12:46 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 21 Sep 2015 14:20:09 +0000 (15:20 +0100)
Due to an error in the regular expression used to extract a port
number specified in $ALL_PROXY, rather than allowing the port number
to be followed by an optional "/", the port was required to be
followed by "/?".

This corrects the regular expression to allow an optional "/". It also
allows the odd "/?" suffix for backwards compatibility.

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
scripts/oe-git-proxy

index 24732829fb71795598f1272a0a3af6bf197bb872..b971c88ec51713ef27419d783f47c42dbd81ff20 100755 (executable)
@@ -113,7 +113,9 @@ done
 # Proxy is necessary, determine protocol, server, and port
 PROTO=$(echo $ALL_PROXY | sed -e 's/\([^:]*\):\/\/.*/\1/')
 PROXY=$(echo $ALL_PROXY | sed -e 's/.*:\/\/\([^:]*\).*/\1/')
-PORT=$(echo $ALL_PROXY | sed -e 's/.*:\([0-9]*\)\/?$/\1/')
+# For backwards compatibility, this allows the port number to be followed by /?
+# in addition to the customary optional /
+PORT=$(echo $ALL_PROXY | sed -e 's/.*:\([0-9]*\)\(\/?\?\)\?$/\1/')
 if [ "$PORT" = "$ALL_PROXY" ]; then
        PORT=""
 fi