Browse Source

Add 'anbox_preparecheck.sh'

anbox
Fincer 3 years ago
parent
commit
37b1e07fe8
1 changed files with 64 additions and 0 deletions
  1. +64
    -0
      anbox_preparecheck.sh

+ 64
- 0
anbox_preparecheck.sh View File

@ -0,0 +1,64 @@
#!/bin/sh
# This script checks availability of different Android source code sub-projects
# for a user-determined Android version (BASEVER) using a pre-defined Android
# platform manifest file as basis (XMLURL).
#
# Goal of this script is to automate detection of these sub-projects
# to help generating a valid Android platform manifest file for AOSP source code
# compilation.
BASEURL="https://android.googlesource.com/"
BASEVER="android-10.0.0_r41"
XMLURL="https://fjordtek.com/git/Fincer/anbox-platform_manifests/raw/branch/anbox/default.xml"
SUBURLS=()
NOK_SUBURLS=()
NOK_SUBURLS_VERSIONINFO=()
echo "
Target version: ${BASEVER}
Reference Android manifest: ${XMLURL}
"
for subUrl in $(curl -s ${XMLURL} | grep -oP '(?<=name=").*?(?=")' | tr '\n' ' '); do
SUBURLS+=(${subUrl})
done
for subUrl in ${SUBURLS[@]}; do
ANDROID_VERSIONS=$(curl -s ${BASEURL}${subUrl} | grep -oP '(?<=refs/tags/).*?(?=")' | tr '\n' ' ')
match=0
if [[ ${#ANDROID_VERSIONS[@]} != 0 ]]; then
for av in ${ANDROID_VERSIONS[@]}; do
if [[ ${av} == ${BASEVER} ]]; then
match=1
echo -e "OK\t${subUrl}"
break 1
fi
done
if [[ ${match} == 0 ]]; then
NOK_SUBURLS+=(${subUrl})
fi
else
NOK_SUBURLS_VERSIONINFO+=(${subUrl}})
fi
done
echo -e "\n"
if [[ ${#NOK_SUBURLS[@]} != 0 ]] || [[ ${#NOK_SUBURLS_VERSIONINFO[@]} != 0 ]]; then
echo -e "You may need to look for replacements or delete these ones from the provided manifest:\n"
fi
if [[ ${#NOK_SUBURLS[@]} != 0 ]]; then
echo -e "NOK sub urls are:\n$(for i in ${NOK_SUBURLS[@]}; do echo -e ${i}; done)\n"
fi
if [[ ${#NOK_SUBURLS_VERSIONINFO[@]} != 0 ]]; then
echo -e "Couldn't get Android versions for urls:\n$(for i in ${NOK_SUBURLS_VERSIONINFO[@]}; do echo -e ${i}; done)\n"
fi

Loading…
Cancel
Save