Android manifests to compile AOSP for Anbox
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

64 lines
1.7 KiB

  1. #!/bin/sh
  2. # This script checks availability of different Android source code sub-projects
  3. # for a user-determined Android version (BASEVER) using a pre-defined Android
  4. # platform manifest file as basis (XMLURL).
  5. #
  6. # Goal of this script is to automate detection of these sub-projects
  7. # to help generating a valid Android platform manifest file for AOSP source code
  8. # compilation.
  9. BASEURL="https://android.googlesource.com/"
  10. BASEVER="android-10.0.0_r41"
  11. XMLURL="https://fjordtek.com/git/Fincer/anbox-platform_manifests/raw/branch/anbox/default.xml"
  12. SUBURLS=()
  13. NOK_SUBURLS=()
  14. NOK_SUBURLS_VERSIONINFO=()
  15. echo "
  16. Target version: ${BASEVER}
  17. Reference Android manifest: ${XMLURL}
  18. "
  19. for subUrl in $(curl -s ${XMLURL} | grep -oP '(?<=name=").*?(?=")' | tr '\n' ' '); do
  20. SUBURLS+=(${subUrl})
  21. done
  22. for subUrl in ${SUBURLS[@]}; do
  23. ANDROID_VERSIONS=$(curl -s ${BASEURL}${subUrl} | grep -oP '(?<=refs/tags/).*?(?=")' | tr '\n' ' ')
  24. match=0
  25. if [[ ${#ANDROID_VERSIONS[@]} != 0 ]]; then
  26. for av in ${ANDROID_VERSIONS[@]}; do
  27. if [[ ${av} == ${BASEVER} ]]; then
  28. match=1
  29. echo -e "OK\t${subUrl}"
  30. break 1
  31. fi
  32. done
  33. if [[ ${match} == 0 ]]; then
  34. NOK_SUBURLS+=(${subUrl})
  35. fi
  36. else
  37. NOK_SUBURLS_VERSIONINFO+=(${subUrl}})
  38. fi
  39. done
  40. echo -e "\n"
  41. if [[ ${#NOK_SUBURLS[@]} != 0 ]] || [[ ${#NOK_SUBURLS_VERSIONINFO[@]} != 0 ]]; then
  42. echo -e "You may need to look for replacements or delete these ones from the provided manifest:\n"
  43. fi
  44. if [[ ${#NOK_SUBURLS[@]} != 0 ]]; then
  45. echo -e "NOK sub urls are:\n$(for i in ${NOK_SUBURLS[@]}; do echo -e ${i}; done)\n"
  46. fi
  47. if [[ ${#NOK_SUBURLS_VERSIONINFO[@]} != 0 ]]; then
  48. echo -e "Couldn't get Android versions for urls:\n$(for i in ${NOK_SUBURLS_VERSIONINFO[@]}; do echo -e ${i}; done)\n"
  49. fi