Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 29e64426 authored by Alexandre Roux's avatar Alexandre Roux
Browse files

fix lineage recognition regex

parent d7089ace
Loading
Loading
Loading
Loading
+15 −19
Original line number Diff line number Diff line
@@ -83,41 +83,37 @@ for branch in ${BRANCH_NAME//,/ }; do

  if [ -n "$branch" ] && [ -n "$devices" ]; then
    vendor=lineage
    case "$branch" in
      v*-nougat*)
    regex_part1="^v[0-9](\.[0-9]*){0,2}(-(beta|alpha|rc)(\.[0-9]*){0,1}){0,1}-("
    regex_part2=")(-[a-zA-Z0-9_]*)*$"
    
    if [[ "${BRANCH_NAME}" =~ $regex_part1"nougat"$regex_part2 ]]; then
      vendor="cm"
        themuppets_branch="cm-14.1"
        android_version="7.1.2"
        ;;
      v*-oreo*)
        use_openjdk_from_ubuntu=true
    elif [[ "${BRANCH_NAME}" =~ $regex_part1"oreo"$regex_part2 ]]; then
        themuppets_branch="lineage-15.1"
        android_version="8.1"
        ;;
      v*-pie*)
        use_openjdk_from_ubuntu=true
    elif [[ "${BRANCH_NAME}" =~ $regex_part1"pie"$regex_part2 ]]; then
        themuppets_branch="lineage-16.0"
        android_version="9"
        ;;
      v*-q*)
    elif [[ "${BRANCH_NAME}" =~ $regex_part1"q"$regex_part2 ]]; then
        themuppets_branch="lineage-17.1"
        android_version="10"
        ;;
      v*-r*)
    elif [[ "${BRANCH_NAME}" =~ $regex_part1"r"$regex_part2 ]]; then
        themuppets_branch="lineage-18.1"
        android_version="11"
        ;;
      v*-s*)
    elif [[ "${BRANCH_NAME}" =~ $regex_part1"s"$regex_part2 ]]; then
        themuppets_branch="lineage-19.1"
        android_version="12"
        ;;
      v*-t*)
    elif [[ "${BRANCH_NAME}" =~ $regex_part1"t"$regex_part2 ]]; then
        themuppets_branch="lineage-20.0"
        android_version="13"
        ;;
      *)
    else
        echo ">> [$(date)] Building branch $branch is not (yet) suppported"
        exit 1
        ;;
      esac
    fi

    android_version_major=$(cut -d '.' -f 1 <<< $android_version)

+31 −37
Original line number Diff line number Diff line
@@ -39,43 +39,37 @@ branch_dir=${branch_dir^^}

if [ -n "${BRANCH_NAME}" ] && [ -n "${DEVICE}" ]; then
    vendor=lineage
  case "$BRANCH_NAME" in
    v*-nougat*)
    regex_part1="^v[0-9](\.[0-9]*){0,2}(-(beta|alpha|rc)(\.[0-9]*){0,1}){0,1}-("
    regex_part2=")(-[a-zA-Z0-9_]*)*$"
    
    if [[ "${BRANCH_NAME}" =~ $regex_part1"nougat"$regex_part2 ]]; then
      vendor="cm"
        themuppets_branch="cm-14.1"
        android_version="7.1.2"
        use_openjdk_from_ubuntu=true
      ;;
    v*-oreo*)
    elif [[ "${BRANCH_NAME}" =~ $regex_part1"oreo"$regex_part2 ]]; then
        themuppets_branch="lineage-15.1"
        android_version="8.1"
        use_openjdk_from_ubuntu=true
      ;;
    v*-pie*)
    elif [[ "${BRANCH_NAME}" =~ $regex_part1"pie"$regex_part2 ]]; then
        themuppets_branch="lineage-16.0"
        android_version="9"
      ;;
    v*-q*)
    elif [[ "${BRANCH_NAME}" =~ $regex_part1"q"$regex_part2 ]]; then
        themuppets_branch="lineage-17.1"
        android_version="10"
      ;;
    v*-r*)
    elif [[ "${BRANCH_NAME}" =~ $regex_part1"r"$regex_part2 ]]; then
        themuppets_branch="lineage-18.1"
        android_version="11"
      ;;
    v*-s*)
    elif [[ "${BRANCH_NAME}" =~ $regex_part1"s"$regex_part2 ]]; then
        themuppets_branch="lineage-19.1"
        android_version="12"
      ;;
    v*-t*)
    elif [[ "${BRANCH_NAME}" =~ $regex_part1"t"$regex_part2 ]]; then
        themuppets_branch="lineage-20.0"
        android_version="13"
      ;;
    *)
    else
        echo ">> [$(date)] Building branch $branch is not (yet) suppported"
        exit 1
      ;;
    esac
    fi

  android_version_major=$(cut -d '.' -f 1 <<< $android_version)