summaryrefslogtreecommitdiff
path: root/gettop.sh
AgeCommit message (Collapse)Author
2022-01-12gettop clean up with parent_dirYifan Hong
Refactors code by defining parent_dir=dirname real_this. Test: TH Bug: 204425264 Change-Id: I141a06f478ec8a8206f40e97ba076b9194345f0d
2022-01-11Use gettop.sh to determine ROOT_DIRYifan Hong
This is step 1 to migrate build/ to build/kernel. Use a consistent logic to determine ROOT_DIR: $(gettop.sh) to determine $ROOT_DIR. This works no matter if build/foo.sh is a real script or a symlink to build/kernel/foo.sh. This works no matter if build/foo.sh or build/kernel/foo.sh is invoked. The location of gettop.sh is determined relative to realpath $0. - For scripts under build/{kernel/,} $($(dirname $(readlink -f $0))/gettop.sh) - For scripts under build/{kernel/,}{static_analysis/,kleaf/} $($(dirname $(dirname $(readlink -f $0)))/gettop.sh) This logic does NOT apply to _setup_env.sh. Because _setup_env.sh is `source`-ed, $0 refers to the script sourcing _setup_env.sh, which is unknown to _setup_env.sh. Its original logic works, so preserve it. Bug: 204425264 Test: TH Change-Id: Ia0432c2db932234944d4828a5bf22277eb892d37