summaryrefslogtreecommitdiff
path: root/yocto-poky/scripts/oe-git-proxy
diff options
context:
space:
mode:
Diffstat (limited to 'yocto-poky/scripts/oe-git-proxy')
-rwxr-xr-xyocto-poky/scripts/oe-git-proxy12
1 files changed, 10 insertions, 2 deletions
diff --git a/yocto-poky/scripts/oe-git-proxy b/yocto-poky/scripts/oe-git-proxy
index 48734556a..d2e9f925b 100755
--- a/yocto-poky/scripts/oe-git-proxy
+++ b/yocto-poky/scripts/oe-git-proxy
@@ -53,6 +53,7 @@ match_ipv4() {
# Determine the mask bitlength
BITS=${CIDR##*/}
+ [ "$BITS" != "$CIDR" ] || BITS=32
if [ -z "$BITS" ]; then
return 1
fi
@@ -112,16 +113,23 @@ 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
-if [ "$PROTO" = "socks" ]; then
+if [ "$PROTO" = "socks" ] || [ "$PROTO" = "socks4a" ]; then
if [ -z "$PORT" ]; then
PORT="1080"
fi
METHOD="SOCKS4A:$PROXY:$1:$2,socksport=$PORT"
+elif [ "$PROTO" = "socks4" ]; then
+ if [ -z "$PORT" ]; then
+ PORT="1080"
+ fi
+ METHOD="SOCKS4:$PROXY:$1:$2,socksport=$PORT"
else
# Assume PROXY (http, https, etc)
if [ -z "$PORT" ]; then