]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
oe-init-build-env: create a symlink in BUILDDIR rbt/symlink
authorRobert Yang <liezhi.yang@windriver.com>
Thu, 16 Feb 2017 02:55:39 +0000 (18:55 -0800)
committerRobert Yang <liezhi.yang@windriver.com>
Thu, 16 Feb 2017 08:53:02 +0000 (00:53 -0800)
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 <liezhi.yang@windriver.com>
oe-init-build-env
oe-init-build-env-memres

index 5fe68d1e2a36acd3916e0aa45c4d8f20f45bfa22..5a41bb2445255b9c2004f66b939b138f2def7126 100755 (executable)
@@ -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"
index 9e1425ea83f06e37e854e1de06068533015dd25d..71a4857f5b29dba2c7bdb0882a4fe0e75b7ed539 100755 (executable)
@@ -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"