blob: eb5698865bae4d5bd5f80fa58b77fd211ce26b14 [file] [log] [blame]
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#$(gettop)\/##; 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 fetch_device()
{
"$(gettop)"/vendor/leaf/tools/fetch_device.py -t "$(gettop)" "$@"
}
function repopick()
{
ANDROID_BUILD_TOP="$(gettop)" "$(gettop)"/vendor/leaf/tools/repopick.py "$@"
}