From 873fa569d565553fab348d4af6dcbe137dc52511 Mon Sep 17 00:00:00 2001 From: Steve Kondik Date: Mon, 17 Sep 2012 11:33:18 -0700 Subject: build: Add "aospremote" command * Adds the git remote for the matching AOSP repository. Change-Id: Iad03fb95874ff39a39083218aec0d834e82b4480 --- envsetup.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'envsetup.sh') diff --git a/envsetup.sh b/envsetup.sh index bd22cfa..8c82b8d 100644 --- a/envsetup.sh +++ b/envsetup.sh @@ -23,6 +23,7 @@ Invoke ". build/envsetup.sh" from your shell to add the following functions to y - cmremote: Add git remote for CM Gerrit Review - cmgerrit: A Git wrapper that fetches/pushes patch from/to CM Gerrit Review - cmrebase: Rebase a Gerrit change and push it again +- aospremote: Add git remote for matching AOSP repository - mka: Builds using SCHED_BATCH on all processors - reposync: Parallel repo sync using ionice and SCHED_BATCH @@ -1606,6 +1607,23 @@ function cmremote() } export -f cmremote +function aospremote() +{ + git remote rm aosp 2> /dev/null + if [ ! -d .git ] + then + echo .git directory not found. Please run this from the root directory of the Android repository you wish to set up. + fi + PROJECT=`pwd | sed s#$ANDROID_BUILD_TOP/##g` + if (echo $PROJECT | grep -qv "^device") + then + PFX="platform/" + fi + git remote add aosp https://android.googlesource.com/$PFX$PROJECT + echo "Remote 'aosp' created" +} +export -f aospremote + function makerecipe() { if [ -z "$1" ] then -- cgit v1.1