Fix cogsetup.sh to work from non-root dirs
Test: source make/envsetup.sh Change-Id: I36de407dbbb0cf266f1701d0895ba71d3ad41dba
This commit is contained in:
parent
0a45b9e89f
commit
79effa56c5
1 changed files with 9 additions and 6 deletions
13
cogsetup.sh
13
cogsetup.sh
|
@ -21,18 +21,21 @@ function _create_out_symlink_for_cog() {
|
||||||
OUT_DIR="out"
|
OUT_DIR="out"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -L "${OUT_DIR}" ]]; then
|
# getoutdir ensures paths are absolute. envsetup could be called from a
|
||||||
|
# directory other than the root of the source tree
|
||||||
|
local outdir=$(getoutdir)
|
||||||
|
if [[ -L "${outdir}" ]]; then
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
if [ -d "${OUT_DIR}" ]; then
|
if [ -d "${outdir}" ]; then
|
||||||
echo -e "\tOutput directory ${OUT_DIR} cannot be present in a Cog workspace."
|
echo -e "\tOutput directory ${outdir} cannot be present in a Cog workspace."
|
||||||
echo -e "\tDelete \"${OUT_DIR}\" or create a symlink from \"${OUT_DIR}\" to a directory outside your workspace."
|
echo -e "\tDelete \"${outdir}\" or create a symlink from \"${outdir}\" to a directory outside your workspace."
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
DEFAULT_OUTPUT_DIR="${HOME}/.cog/android-build-out"
|
DEFAULT_OUTPUT_DIR="${HOME}/.cog/android-build-out"
|
||||||
mkdir -p ${DEFAULT_OUTPUT_DIR}
|
mkdir -p ${DEFAULT_OUTPUT_DIR}
|
||||||
ln -s ${DEFAULT_OUTPUT_DIR} `pwd`/out
|
ln -s ${DEFAULT_OUTPUT_DIR} ${outdir}
|
||||||
}
|
}
|
||||||
|
|
||||||
# This function sets up the build environment to be appropriate for Cog.
|
# This function sets up the build environment to be appropriate for Cog.
|
||||||
|
|
Loading…
Reference in a new issue