summaryrefslogtreecommitdiffstats
path: root/scripts/oe-git-proxy
diff options
context:
space:
mode:
authorAndré Draszik <git@andred.net>2016-07-15 15:03:27 (GMT)
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-07-20 09:28:51 (GMT)
commitbffb0fbfcc96b590111b7fc4e082865f12c14f9e (patch)
tree9110cb022464612a85dc58e7cc4f5294739005cb /scripts/oe-git-proxy
parentdd0474c7e8294e922f94f6ab70acd646bd85c72b (diff)
downloadpoky-bffb0fbfcc96b590111b7fc4e082865f12c14f9e.tar.gz
oe-git-proxy: don't depend on syslinux
gethostip comes from syslinux. It seems odd to depend on a bootloader to clone a git repository. Switch to using getent from the c-library, which should be available on every system. We now also support the case where a hostname resolves to more than one IP address. (From OE-Core rev: c91dbf3ca2faec95195c85b65aa6cab7de9bca2c) Signed-off-by: André Draszik <git@andred.net> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/oe-git-proxy')
-rwxr-xr-xscripts/oe-git-proxy13
1 files changed, 7 insertions, 6 deletions
diff --git a/scripts/oe-git-proxy b/scripts/oe-git-proxy
index 1247902..0078e95 100755
--- a/scripts/oe-git-proxy
+++ b/scripts/oe-git-proxy
@@ -86,13 +86,14 @@ match_host() {
86 86
87 # Match by netmask 87 # Match by netmask
88 if valid_ipv4 $GLOB; then 88 if valid_ipv4 $GLOB; then
89 HOST_IP=$(gethostip -d $HOST) 89 for HOST_IP in $(getent ahostsv4 $HOST | grep ' STREAM ' | cut -d ' ' -f 1) ; do
90 if valid_ipv4 $HOST_IP; then 90 if valid_ipv4 $HOST_IP; then
91 match_ipv4 $GLOB $HOST_IP 91 match_ipv4 $GLOB $HOST_IP
92 if [ $? -eq 0 ]; then 92 if [ $? -eq 0 ]; then
93 return 0 93 return 0
94 fi
94 fi 95 fi
95 fi 96 done
96 fi 97 fi
97 98
98 return 1 99 return 1