From 335fdc9ba14019e62b29119cf8fe6875a7fb9076 Mon Sep 17 00:00:00 2001 From: Robert Yang Date: Wed, 15 Feb 2017 18:55:39 -0800 Subject: oe-init-build-env: create a symlink in BUILDDIR When there are multiple oe-core repos (for example, poky-master, poky-morty and poky-krogoth) and multiple builddirs for them, it's not easy to reinit builddir in such a case, and very easy to make mistakes. Create a symlink in builddir will make it easy, for example: e.g.: $ . poky-morty/oe-init-build-env test_m $ ls -l oe-init-build-env oe-init-build-env -> /buildarea/lyang1/poky-morty/oe-init-build-env When we want to reinit the builddir test_m: $ . oe-init-build-env . Signed-off-by: Robert Yang --- oe-init-build-env | 6 +++++- oe-init-build-env-memres | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/oe-init-build-env b/oe-init-build-env index 5fe68d1e2a..5a41bb2445 100755 --- a/oe-init-build-env +++ b/oe-init-build-env @@ -41,9 +41,9 @@ if [ -z "$ZSH_NAME" ] && [ "$0" = "$THIS_SCRIPT" ]; then exit 1 fi +THIS_SCRIPT=$(readlink -f $THIS_SCRIPT) if [ -z "$OEROOT" ]; then OEROOT=$(dirname "$THIS_SCRIPT") - OEROOT=$(readlink -f "$OEROOT") fi unset THIS_SCRIPT @@ -53,6 +53,10 @@ export OEROOT unset OEROOT return 1 } + +# Create a symlink +ln -sf $OEROOT/oe-init-build-env $BUILDDIR + unset OEROOT [ -z "$BUILDDIR" ] || cd "$BUILDDIR" diff --git a/oe-init-build-env-memres b/oe-init-build-env-memres index 9e1425ea83..71a4857f5b 100755 --- a/oe-init-build-env-memres +++ b/oe-init-build-env-memres @@ -49,9 +49,9 @@ if [ -z "$ZSH_NAME" ] && [ "$0" = "$THIS_SCRIPT" ]; then exit 1 fi +THIS_SCRIPT=$(readlink -f $THIS_SCRIPT) if [ -z "$OEROOT" ]; then OEROOT=$(dirname "$THIS_SCRIPT") - OEROOT=$(readlink -f "$OEROOT") fi unset THIS_SCRIPT @@ -61,6 +61,10 @@ export OEROOT unset OEROOT return 1 } + +# Create a symlink +ln -sf $OEROOT/oe-init-build-env-memres $BUILDDIR + unset OEROOT [ -z "$BUILDDIR" ] || cd "$BUILDDIR" -- cgit 1.2.3-korg