function __print_aospa_functions_help() { cat < /dev/null then echo ".git directory not found. Please run this from the root directory of the Android repository you wish to set up." return 1 fi git remote rm aospagerrit 2> /dev/null local REMOTE=$(git config --get remote.aospa.projectname) local AOSPA="true" if [ -z "$REMOTE" ] then REMOTE=$(git config --get remote.aosp.projectname) AOSPA="false" fi if [ -z "$REMOTE" ] then REMOTE=$(git config --get remote.caf.projectname) AOSPA="false" fi if [ $AOSPA = "false" ] then local PROJECT=$(echo $REMOTE | sed -e "s#platform/#android/#g; s#/#_#g") local PFX="AOSPA/" else local PROJECT=$REMOTE fi local AOSPA_USER=$(git config --get review.gerrit.aospa.co.username) if [ -z "$AOSPA_USER" ] then git remote add aospagerrit ssh://gerrit.aospa.co:29418/$PFX$PROJECT else git remote add aospagerrit ssh://$AOSPA_USER@gerrit.aospa.co:29418/$PFX$PROJECT fi echo "Remote 'aospagerrit' created" } function aospremote() { if ! git rev-parse --git-dir &> /dev/null then echo ".git directory not found. Please run this from the root directory of the Android repository you wish to set up." return 1 fi git remote rm aosp 2> /dev/null local PROJECT=$(pwd -P | sed -e "s#$ANDROID_BUILD_TOP\/##; s#-caf.*##; s#\/default##") # Google moved the repo location in Oreo if [ $PROJECT = "build/make" ] then PROJECT="build" fi if (echo $PROJECT | grep -qv "^device") then local PFX="platform/" fi git remote add aosp https://android.googlesource.com/$PFX$PROJECT echo "Remote 'aosp' created" } function cafremote() { if ! git rev-parse --git-dir &> /dev/null then echo ".git directory not found. Please run this from the root directory of the Android repository you wish to set up." return 1 fi git remote rm caf 2> /dev/null local PROJECT=$(pwd -P | sed -e "s#$ANDROID_BUILD_TOP\/##; s#-caf.*##; s#\/default##") # Google moved the repo location in Oreo if [ $PROJECT = "build/make" ] then PROJECT="build" fi if [[ $PROJECT =~ "qcom/opensource" ]]; then PROJECT=$(echo $PROJECT | sed -e "s#qcom\/opensource#qcom-opensource#") fi if (echo $PROJECT | grep -qv "^device") then local PFX="platform/" fi git remote add caf https://source.codeaurora.org/quic/la/$PFX$PROJECT echo "Remote 'caf' created" } function githubremote() { if ! git rev-parse --git-dir &> /dev/null then echo ".git directory not found. Please run this from the root directory of the Android repository you wish to set up." return 1 fi git remote rm aospa 2> /dev/null local REMOTE=$(git config --get remote.caf.projectname) if [ -z "$REMOTE" ] then REMOTE=$(git config --get remote.aospa.projectname) fi local PROJECT=$(echo $REMOTE | sed -e "s#platform/#android/#g; s#/#_#g") if [[ $PROJECT =~ "qcom-opensource" ]]; then PROJECT=$(echo $PROJECT | sed -e "s#qcom-opensource#qcom_opensource#") fi git remote add aospa https://github.com/AOSPA/$PROJECT echo "Remote 'aospa' created" } function repolastsync() { RLSPATH="$ANDROID_BUILD_TOP/.repo/.repo_fetchtimes.json" RLSLOCAL=$(date -d "$(stat -c %z $RLSPATH)" +"%e %b %Y, %T %Z") RLSUTC=$(date -d "$(stat -c %z $RLSPATH)" -u +"%e %b %Y, %T %Z") echo "Last repo sync: $RLSLOCAL / $RLSUTC" } function repopick() { T=$(gettop) $T/vendor/pa/build/tools/repopick.py $@ } function cafmerge() { target_branch=$1 set_stuff_for_environment T=$(gettop) python3 $T/vendor/pa/scripts/merge-caf.py $target_branch }