From c91dbf3ca2faec95195c85b65aa6cab7de9bca2c Mon Sep 17 00:00:00 2001 From: André Draszik Date: Fri, 15 Jul 2016 16:03:27 +0100 Subject: oe-git-proxy: don't depend on syslinux MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. Signed-off-by: André Draszik Signed-off-by: Ross Burton --- scripts/oe-git-proxy | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/scripts/oe-git-proxy b/scripts/oe-git-proxy index 1247902406..0078e95450 100755 --- a/scripts/oe-git-proxy +++ b/scripts/oe-git-proxy @@ -86,13 +86,14 @@ match_host() { # Match by netmask if valid_ipv4 $GLOB; then - HOST_IP=$(gethostip -d $HOST) - if valid_ipv4 $HOST_IP; then - match_ipv4 $GLOB $HOST_IP - if [ $? -eq 0 ]; then - return 0 + for HOST_IP in $(getent ahostsv4 $HOST | grep ' STREAM ' | cut -d ' ' -f 1) ; do + if valid_ipv4 $HOST_IP; then + match_ipv4 $GLOB $HOST_IP + if [ $? -eq 0 ]; then + return 0 + fi fi - fi + done fi return 1 -- cgit 1.2.3-korg