summaryrefslogtreecommitdiffstats
path: root/envsetup.sh
diff options
context:
space:
mode:
authorWolfgang Wiedmeyer <wolfgit@wiedmeyer.de>2016-12-13 02:00:48 +0100
committerWolfgang Wiedmeyer <wolfgit@wiedmeyer.de>2016-12-13 02:00:48 +0100
commitf0e2077caea3afc6456b046c66989b780f8c1111 (patch)
tree5410cd542c0f842a3536d74a8a7a5f985808fc18 /envsetup.sh
parent6662a629cef6f9bcf7edf0885080e3857b8b49b5 (diff)
parentea2aaaeee4322b13eb1fd48342fc8f4a8109a83f (diff)
downloadbuild-f0e2077caea3afc6456b046c66989b780f8c1111.zip
build-f0e2077caea3afc6456b046c66989b780f8c1111.tar.gz
build-f0e2077caea3afc6456b046c66989b780f8c1111.tar.bz2
Merge branch 'cm-13.0' of https://github.com/CyanogenMod/android_build into replicant-6.0
Diffstat (limited to 'envsetup.sh')
-rw-r--r--envsetup.sh36
1 files changed, 17 insertions, 19 deletions
diff --git a/envsetup.sh b/envsetup.sh
index f153592..f8ec4ed 100644
--- a/envsetup.sh
+++ b/envsetup.sh
@@ -1676,13 +1676,13 @@ function godir () {
function cmremote()
{
- git remote rm cmremote 2> /dev/null
- GERRIT_REMOTE=$(git config --get remote.github.projectname)
- if [ -z "$GERRIT_REMOTE" ]
+ if ! git rev-parse --git-dir &> /dev/null
then
- echo Unable to set up the git remote, are you under a git repo?
- return 0
+ 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 cmremote 2> /dev/null
+ GERRIT_REMOTE=$(git config --get remote.github.projectname)
CMUSER=$(git config --get review.review.cyanogenmod.org.username)
if [ -z "$CMUSER" ]
then
@@ -1690,17 +1690,18 @@ function cmremote()
else
git remote add cmremote ssh://$CMUSER@review.cyanogenmod.org:29418/$GERRIT_REMOTE
fi
- echo You can now push to "cmremote".
+ echo "Remote 'cmremote' created"
}
function aospremote()
{
- git remote rm aosp 2> /dev/null
- if [ ! -d .git ]
+ 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.
+ echo ".git directory not found. Please run this from the root directory of the Android repository you wish to set up."
+ return 1
fi
- PROJECT=`pwd -P | sed s#$ANDROID_BUILD_TOP/##g`
+ git remote rm aosp 2> /dev/null
+ PROJECT=$(pwd -P | sed -e "s#$ANDROID_BUILD_TOP\/##; s#-caf.*##; s#\/default##")
if (echo $PROJECT | grep -qv "^device")
then
PFX="platform/"
@@ -1711,12 +1712,13 @@ function aospremote()
function cafremote()
{
- git remote rm caf 2> /dev/null
- if [ ! -d .git ]
+ 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.
+ echo ".git directory not found. Please run this from the root directory of the Android repository you wish to set up."
+ return 1
fi
- PROJECT=`pwd -P | sed s#$ANDROID_BUILD_TOP/##g`
+ git remote rm caf 2> /dev/null
+ PROJECT=$(pwd -P | sed -e "s#$ANDROID_BUILD_TOP\/##; s#-caf.*##; s#\/default##")
if (echo $PROJECT | grep -qv "^device")
then
PFX="platform/"
@@ -2373,11 +2375,7 @@ function fixup_common_out_dir() {
fi
}
-# Force JAVA_HOME to point to java 1.7 if it isn't already set.
-#
-# Note that the MacOS path for java 1.7 includes a minor revision number (sigh).
-# For some reason, installing the JDK doesn't make it show up in the
-# JavaVM.framework/Versions/1.7/ folder.
+# Force JAVA_HOME to point to java 1.7/1.8 if it isn't already set.
function set_java_home() {
# Clear the existing JAVA_HOME value if we set it ourselves, so that
# we can reset it later, depending on the version of java the build