Export all the BUILD_CONFIG env variables

All the environment variables that are generated by sourcing the
BUILD_CONFIG files will be exported, so that children environments can
inherit them.

Test: manual inspection and build
Bug: 138854687
Change-Id: I8790aacc8c4867d996ccd597cc4bdf8882c2a5e5
Signed-off-by: Alessio Balsini <balsini@google.com>
diff --git a/envsetup.sh b/envsetup.sh
index 57d461b..4ba9d17 100644
--- a/envsetup.sh
+++ b/envsetup.sh
@@ -29,7 +29,9 @@
 export ROOT_DIR=$PWD
 
 export BUILD_CONFIG=${BUILD_CONFIG:-build.config}
+set -a
 . ${ROOT_DIR}/${BUILD_CONFIG}
+set +a
 
 export COMMON_OUT_DIR=$(readlink -m ${OUT_DIR:-${ROOT_DIR}/out/${BRANCH}})
 export OUT_DIR=$(readlink -m ${COMMON_OUT_DIR}/${KERNEL_DIR})
@@ -65,8 +67,6 @@
 echo "PATH=${PATH}"
 echo
 
-export $(sed -n -e 's/\([^=]\)=.*/\1/p' ${ROOT_DIR}/${BUILD_CONFIG})
-
 # verifies that defconfig matches the DEFCONFIG
 function check_defconfig() {
     (cd ${OUT_DIR} && \