1
0
mirror of https://github.com/lineageos4microg/docker-lineage-cicd synced 2024-11-09 10:09:56 +01:00

Use build/core/version_defaults.mk to determine the current Android version

This commit is contained in:
Nicola Corna 2017-08-24 00:40:44 +02:00
parent 5fcb95e54f
commit ef9f15ce01

@ -60,15 +60,14 @@ if ! [ -z "$DEVICE_LIST" ]; then
# If needed, apply the MicroG's signature spoofing patch # If needed, apply the MicroG's signature spoofing patch
if [ "$SIGNATURE_SPOOFING" = "yes" ] || [ "$SIGNATURE_SPOOFING" = "restricted" ]; then if [ "$SIGNATURE_SPOOFING" = "yes" ] || [ "$SIGNATURE_SPOOFING" = "restricted" ]; then
# Determine which patch should be applied to the current branch # Determine which patch should be applied to the current Android source tree
patch_name="" patch_name=""
git_branch=$(repo --no-pager info 2> /dev/null | grep -i "Manifest branch: ") android_version=$(sed -n -e 's/^\s*PLATFORM_VERSION := //p' build/core/version_defaults.mk)
git_branch=${git_branch#Manifest branch: } case $android_version in
case $(echo $git_branch | grep -o "cm-[0-9][0-9]*\.[0-9]") in 4.4* ) patch_name="android_frameworks_base-KK-LP.patch" ;;
"cm-11.0") patch_name="android_frameworks_base-KK-LP.patch" ;; 5.* ) patch_name="android_frameworks_base-KK-LP.patch" ;;
"cm-12.0"|"cm-12.1") patch_name="android_frameworks_base-KK-LP.patch" ;; 6.* ) patch_name="android_frameworks_base-M.patch" ;;
"cm-13.0") patch_name="android_frameworks_base-M.patch" ;; 7.* ) patch_name="android_frameworks_base-N.patch" ;;
"cm-14.0"|"cm-14.1") patch_name="android_frameworks_base-N.patch" ;;
esac esac
if ! [ -z $patch_name ]; then if ! [ -z $patch_name ]; then
@ -83,7 +82,7 @@ if ! [ -z "$DEVICE_LIST" ]; then
fi fi
git clean -f git clean -f
else else
echo ">> [$(date)] ERROR: can't find a suitable signature spoofing patch for the current LineageOS branch ($git_branch)" >> $DOCKER_LOG echo ">> [$(date)] ERROR: can't find a suitable signature spoofing patch for the current Android version ($android_version)" >> $DOCKER_LOG
exit 1 exit 1
fi fi
fi fi