Make CT_PREFIX_DIR/CT_WORK_DIR/CT_BUILD_TOP_DIR absolute

... if they aren't already.

Fixes #1010.

Signed-off-by: Alexey Neyman <stilor@att.net>
This commit is contained in:
Alexey Neyman 2018-09-27 01:01:20 -07:00
parent d573c15758
commit 2acab2f061
2 changed files with 13 additions and 4 deletions

View File

@ -42,7 +42,7 @@ config WORK_DIR
config BUILD_TOP_DIR config BUILD_TOP_DIR
string string
default "${CT_WORK_DIR}/${CT_HOST:+HOST-${CT_HOST}/}${CT_TARGET}" default "${CT_WORK_DIR:-${CT_TOP_DIR}/.build}/${CT_HOST:+HOST-${CT_HOST}/}${CT_TARGET}"
config PREFIX_DIR config PREFIX_DIR
string string

View File

@ -74,6 +74,7 @@ for d in \
LOCAL_TARBALLS \ LOCAL_TARBALLS \
WORK \ WORK \
PREFIX \ PREFIX \
BUILD_TOP \
INSTALL \ INSTALL \
; do ; do
eval dir="\${CT_${d}_DIR}" eval dir="\${CT_${d}_DIR}"
@ -88,6 +89,17 @@ for d in \
CT_Abort "'CT_${d}_DIR'='${dir}' contains a comma in it.\nDon't use commas in paths, it breaks things." CT_Abort "'CT_${d}_DIR'='${dir}' contains a comma in it.\nDon't use commas in paths, it breaks things."
;; ;;
esac esac
case "${dir}" in
/*)
# Absolute path, okay
;;
*)
# Relative path from CT_TOP_DIR, make absolute
eval CT_${d}_DIR="${CT_TOP_DIR}/${dir}"
# Having .. inside CT_PREFIX breaks relocatability.
CT_SanitizeVarDir CT_${d}_DIR
;;
esac
done done
# Where will we work? # Where will we work?
@ -315,9 +327,6 @@ CT_DoExecLog DEBUG rm -f "${CT_PREFIX_DIR}/foo"
# Setting up the rest of the environment only if not restarting # Setting up the rest of the environment only if not restarting
if [ -z "${CT_RESTART}" ]; then if [ -z "${CT_RESTART}" ]; then
# Having .. inside CT_PREFIX breaks relocatability.
CT_SanitizeVarDir CT_PREFIX_DIR
case "${CT_SYSROOT_NAME}" in case "${CT_SYSROOT_NAME}" in
"") CT_SYSROOT_NAME="sysroot";; "") CT_SYSROOT_NAME="sysroot";;
.) CT_Abort "Sysroot name is set to '.' which is forbidden";; .) CT_Abort "Sysroot name is set to '.' which is forbidden";;