build: tools: add in roomservice

This is a new implementation of roomservice
use the new github search api to reduce the memory footprint, and make it less processor intensive
allow for unofficial devices to fetch dependencies. just specify your github organization

to fetch dependencies:
    add a file called 'omni.dependencies' to the root of your device tree
    an example configuration for the dependency file is:

[
  {
    "repository": "android_device_sony_common",
    "target_path": "device/sony/common"
  },
  {
    "repository": "legacybop/android_hardware_qcom_display-legacy",
    "target_path": "hardware/qcom/display-legacy",
    "revision": "omni-4.3"
  }

please note that comments can not go into this file. It must be valid json

PatchSet 7:
  add support to change port script to another team with config
  finished pep8'ing
  more checks on manifest parsing

Change-Id: I3d7a8d46d3effbb3d2480c136c9b6b6e610b9b2e
diff --git a/envsetup.sh b/envsetup.sh
index 988499a..5b37af9 100644
--- a/envsetup.sh
+++ b/envsetup.sh
@@ -510,10 +510,29 @@
     build_build_var_cache
     if [ $? -ne 0 ]
     then
-        if [[ "$product" =~ .*_(eng|user|userdebug) ]]
-        then
-            echo "Did you mean -${product/*_/}? (dash instead of underscore)"
-        fi
+        # if we can't find the product, try to grab it from our github
+        T=$(gettop)
+        pushd $T > /dev/null
+        vendor/omni/build/tools/roomservice.py $product
+        popd > /dev/null
+        check_product $product
+    else
+        T=$(gettop)
+        pushd $T > /dev/null
+        vendor/omni/build/tools/roomservice.py $product true
+        popd > /dev/null
+    fi
+    if [ $? -ne 0 ]
+    then
+        echo
+        echo "** Don't have a product spec for: '$product'"
+        echo "** Do you have the right repo manifest?"
+        product=
+    fi
+
+    if [ -z "$product" -o -z "$variant" ]
+    then
+        echo
         return 1
     fi
     export TARGET_PRODUCT=$(_get_build_var_cached TARGET_PRODUCT)