summaryrefslogtreecommitdiffstats
path: root/envsetup.sh
diff options
context:
space:
mode:
authorSimon Shields <keepcalm444@gmail.com>2016-12-28 11:33:29 +1100
committerZhao Wei Liew <zhaoweiliew@gmail.com>2017-01-09 01:13:20 +0000
commit8cd2bcba15c328c124b28fc12cd1b9846633d5d5 (patch)
tree9ae8ab195d09fc43c03aad16976cfd47bd89b6ed /envsetup.sh
parentbb05c8fc87643e7594b53b0fc6a3217745a2b0a3 (diff)
downloadbuild-8cd2bcba15c328c124b28fc12cd1b9846633d5d5.zip
build-8cd2bcba15c328c124b28fc12cd1b9846633d5d5.tar.gz
build-8cd2bcba15c328c124b28fc12cd1b9846633d5d5.tar.bz2
build: support lineage device trees
Change-Id: I087a97e31cab2ccfba16b5378cef429785baf7d0
Diffstat (limited to 'envsetup.sh')
-rw-r--r--envsetup.sh23
1 files changed, 17 insertions, 6 deletions
diff --git a/envsetup.sh b/envsetup.sh
index 42823df..8030ce4 100644
--- a/envsetup.sh
+++ b/envsetup.sh
@@ -84,11 +84,17 @@ 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)
else
- CM_BUILD=
+ # Fall back to cm_<product>
+ 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)
+ else
+ CM_BUILD=
+ fi
fi
export CM_BUILD
@@ -568,11 +574,16 @@ function breakfast()
# A buildtype was specified, assume a full device name
lunch $target
else
- # This is probably just the CM model name
+ # This is probably just the Lineage model name
if [ -z "$variant" ]; then
variant="userdebug"
fi
- lunch cm_$target-$variant
+ lunch lineage_$target-$variant
+ if [ $? -ne 0 ]; then
+ # try CM
+ echo "** Warning: '$target' is using CM-based makefiles. This will be deprecated in the next major release."
+ lunch cm_$target-$variant
+ fi
fi
fi
return $?