envsetup: dopush: allow (symbolic) host names for adb connect

Change-Id: Icfab874abab64b0a3e5e63091cb6c25dd9630737
Signed-off-by: Marc K <morckx@gmail.com>
diff --git a/build/envsetup.sh b/build/envsetup.sh
index a5b8b97..72bdfd4 100644
--- a/build/envsetup.sh
+++ b/build/envsetup.sh
@@ -789,7 +789,8 @@
     if (adb shell getprop ro.cm.device | grep -q "$CM_BUILD") || [ "$FORCE_PUSH" = "true" ];
     then
     # retrieve IP and PORT info if we're using a TCP connection
-    TCPIPPORT=$(adb devices | egrep '^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+:[0-9]+[^0-9]+' \
+    TCPIPPORT=$(adb devices \
+        | egrep '^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9]):[0-9]+[^0-9]+' \
         | head -1 | awk '{print $1}')
     adb root &> /dev/null
     sleep 0.3