[oe-commits] [openembedded-core] 98/122: oe-git-proxy: don't depend on syslinux
git at git.openembedded.org
git at git.openembedded.org
Tue Jul 19 14:07:18 UTC 2016
rpurdie pushed a commit to branch master-next
in repository openembedded-core.
commit a72ee1950061e2b4bcd84451678d62fd70e30c27
Author: André Draszik <git at andred.net>
AuthorDate: Fri Jul 15 16:03:27 2016 +0100
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.
Signed-off-by: André Draszik <git at andred.net>
Signed-off-by: Ross Burton <ross.burton at intel.com>
---
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 1247902..0078e95 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
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Openembedded-commits
mailing list