From: Steve Kondik Date: Mon, 17 Sep 2012 18:33:18 +0000 (-0700) Subject: build: Add "aospremote" command X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=068d3a12e514726ead29c1501c5bef71b1e140a6;p=android-x86%2Fbuild.git build: Add "aospremote" command * Adds the git remote for the matching AOSP repository. Change-Id: Iad03fb95874ff39a39083218aec0d834e82b4480 --- diff --git a/envsetup.sh b/envsetup.sh index 3efe972dd..62224c09b 100644 --- a/envsetup.sh +++ b/envsetup.sh @@ -24,6 +24,7 @@ Invoke ". build/envsetup.sh" from your shell to add the following functions to y - godir: Go to the directory containing a file. - cmremote: Add git remote for CM Gerrit Review - cmgerrit: A Git wrapper that fetches/pushes patch from/to CM Gerrit Review +- aospremote: Add git remote for matching AOSP repository - cmrebase: Rebase a Gerrit change and push it again - mka: Builds using SCHED_BATCH on all processors - reposync: Parallel repo sync using ionice and SCHED_BATCH @@ -1698,6 +1699,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