summaryrefslogtreecommitdiffstats
path: root/scripts/oe-buildenv-internal
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/oe-buildenv-internal')
-rwxr-xr-xscripts/oe-buildenv-internal23
1 files changed, 15 insertions, 8 deletions
diff --git a/scripts/oe-buildenv-internal b/scripts/oe-buildenv-internal
index 117b0c593e..61ac18c14e 100755
--- a/scripts/oe-buildenv-internal
+++ b/scripts/oe-buildenv-internal
@@ -28,14 +28,21 @@ if [ "x$BDIR" = "x" ]; then
28 if [ "x$1" = "x" ]; then 28 if [ "x$1" = "x" ]; then
29 BDIR="build" 29 BDIR="build"
30 else 30 else
31 BDIR=`readlink -f "$1"` 31 BDIR="$1"
32 if [ -z "$BDIR" ]; then 32 if [ "$BDIR" = "/" ]; then
33 if expr "$1" : '.*/$' >/dev/null; then 33 echo >&2 "Error: / is not supported as a build directory."
34 echo >&2 "Error: please remove any trailing / in the argument." 34 return 1
35 else 35 fi
36 PARENTDIR=`dirname "$1"` 36
37 echo >&2 "Error: the directory $PARENTDIR doesn't exist?" 37 # Remove any possible trailing slashes. This is used to work around
38 fi 38 # buggy readlink in Ubuntu 10.04 that doesn't ignore trailing slashes
39 # and hence "readlink -f new_dir_to_be_created/" returns empty.
40 BDIR=`echo $BDIR | sed -re 's|/+$||'`
41
42 BDIR=`readlink -f "$BDIR"`
43 if [ -z "$BDIR" ]; then
44 PARENTDIR=`dirname "$1"`
45 echo >&2 "Error: the directory $PARENTDIR does not exist?"
39 return 1 46 return 1
40 fi 47 fi
41 fi 48 fi