OSDN Git Service

Merge tag 'android-7.1.2_r24' into cm-14.1
[android-x86/build.git] / envsetup.sh
index 5962ec1..814bcf5 100644 (file)
@@ -132,11 +132,15 @@ function check_product()
         return
     fi
 
-    if (echo -n $1 | grep -q -e "^cm_") ; then
-       CM_BUILD=$(echo -n $1 | sed -e 's/^cm_//g')
-       export BUILD_NUMBER=$((date +%s%N ; echo $CM_BUILD; hostname) | openssl sha1 | sed -e 's/.*=//g; s/ //g' | cut -c1-10)
+    if (echo -n $1 | grep -q -e "^lineage_") ; then
+        CM_BUILD=$(echo -n $1 | sed -e 's/^lineage_//g')
+        export BUILD_NUMBER=$( (date +%s%N ; echo $CM_BUILD; hostname) | openssl sha1 | sed -e 's/.*=//g; s/ //g' | cut -c1-10 )
+    elif (echo -n $1 | grep -q -e "^cm_") ; then
+        # Fall back to cm_<product>
+        CM_BUILD=$(echo -n $1 | sed -e 's/^cm_//g')
+        export BUILD_NUMBER=$( (date +%s%N ; echo $CM_BUILD; hostname) | openssl sha1 | sed -e 's/.*=//g; s/ //g' | cut -c1-10 )
     else
-       CM_BUILD=
+        CM_BUILD=
     fi
     export CM_BUILD
 
@@ -272,10 +276,6 @@ function setpaths()
     unset ANDROID_HOST_OUT
     export ANDROID_HOST_OUT=$(get_abs_build_var HOST_OUT)
 
-    if [ -n "$ANDROID_CCACHE_DIR" ]; then
-        export CCACHE_DIR=$ANDROID_CCACHE_DIR
-    fi
-
     # needed for building linux on MacOS
     # TODO: fix the path
     #export HOST_EXTRACFLAGS="-I "$T/system/kernel_headers/host_include
@@ -624,15 +624,15 @@ function lunch()
     then
         # if we can't find a product, try to grab it off the CM github
         T=$(gettop)
-        pushd $T > /dev/null
+        cd $T > /dev/null
         vendor/cm/build/tools/roomservice.py $product
-        popd > /dev/null
+        cd - > /dev/null
         check_product $product
     else
         T=$(gettop)
-        pushd $T > /dev/null
+        cd $T > /dev/null
         vendor/cm/build/tools/roomservice.py $product true
-        popd > /dev/null
+        cd - > /dev/null
     fi
     TARGET_PRODUCT=$product \
     TARGET_BUILD_VARIANT=$variant \
@@ -1720,4 +1720,4 @@ check_bash_version && {
 
 export ANDROID_BUILD_TOP=$(gettop)
 
-. vendor/cm/build/envsetup.sh
+. $ANDROID_BUILD_TOP/vendor/cm/build/envsetup.sh