diff --git a/vendorsetup.sh b/vendorsetup.sh
index cd2c2203124ad62a27ddb379498b7599defbcd18..8b57fe35a7c336849eb3f5663de50d8164b0608a 100644
--- a/vendorsetup.sh
+++ b/vendorsetup.sh
@@ -29,8 +29,6 @@
 # Environment variables influencing operation:
 #    B2G_TREE_ID - Defines the tree ID, used to determine which patches to
 #        apply.  If unset, |treeid.sh| is run to identify the tree
-#    B2G_PATCH_DIRS_OVERRIDE - List of patch directories to be used instead of
-#        the build defaults.
 #    B2G_USE_REPO - If set, use |repo manifest| to determine when the Android
 #                   tree has changed.  Disabled by default for performance
 #                   reasons.
@@ -39,7 +37,6 @@
 B2G_TREEID_SH=${B2G_TREEID_SH:-device/qcom/b2g_common/treeid.sh}
 B2G_HASHED_FILES="${B2G_HASHED_FILES:-"device/qcom/b2g_common/vendorsetup.sh ${B2G_TREEID_SH}"}"
 REPO="${REPO:-repo}"
-B2G_PATCH_DIRS=${B2G_PATCH_DIRS_OVERRIDE:-device/qcom/b2g_common/patch}
 
 __tree_md5sum()
 {
@@ -75,7 +72,23 @@ __patch_tree()
       cd $(gettop)
       local TREE_ID=${B2G_TREE_ID:-$(${B2G_TREEID_SH})}
 
+      local B2G_PATCH_DIRS=$( \
+        LANG=C sort -u <( \
+          test -d device && find -L device -maxdepth 4 -type d -name patch ; \
+          test -d vendor && find -L vendor -maxdepth 4 -type d -name patch \
+        ) 2> /dev/null \
+      )
+
       echo "Tree IDs: ${TREE_ID}"
+      echo "Patch directories: "
+      for d in ${B2G_PATCH_DIRS}; do
+        echo "  $d"
+      done
+
+      if [[ -z "$B2G_PATCH_DIRS" ]]; then
+        exit
+      fi
+
       set -e
       local LASTMD5SUM=invalid
       local MD5SUM=unknown
@@ -258,10 +271,6 @@ rungdb()
    ( cd $(gettop)/device/qcom/b2g_common && ./run-gdb.sh $@ )
 }
 
-if [[ -f vendor/qcom/proprietary/b2g_common/vendorsetup.sh ]]; then
-   . vendor/qcom/proprietary/b2g_common/vendorsetup.sh
-fi
-
 if [[ -z $1 ]]; then
    __patch_tree
 else