]> code.ossystems Code Review - openembedded-core.git/commitdiff
toolchain-scripts: run post-relocate scripts for every environment
authorRoss Burton <ross.burton@intel.com>
Mon, 7 Jan 2019 15:07:38 +0000 (15:07 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 7 Jan 2019 17:45:38 +0000 (17:45 +0000)
SDKs for multilib configurations have multiple environment scripts, so
re-arrange the post-relocate hook invocation so that it runs the post-relocate
hooks after sourcing each environment script.

Signed-off-by: Ross Burton <ross.burton@intel.com>
meta/classes/toolchain-scripts.bbclass

index 6d1ba69473a99c8c9ba41a2bc7d13e70765ee793..1a2ec4f3b290f0c96716b9476fe07f5c5b1a8f51 100644 (file)
@@ -128,30 +128,30 @@ toolchain_create_post_relocate_script() {
        touch $relocate_script
 
        cat >> $relocate_script <<EOF
-# Source top-level SDK env scripts in case they are needed for the relocate
-# scripts.
-for env_setup_script in ${env_dir}/environment-setup-*; do
-    . \$env_setup_script
-    status=\$?
-    if [ \$status != 0 ]; then
-        echo "\$0: Failed to source \$env_setup_script with status \$status"
-        exit \$status
-    fi
-done
-
 if [ -d "${SDKPATHNATIVE}/post-relocate-setup.d/" ]; then
-    for s in ${SDKPATHNATIVE}/post-relocate-setup.d/*; do
-        if [ ! -x \$s ]; then
-            continue
-        fi
-        \$s "\$1"
-        status=\$?
-        if [ \$status != 0 ]; then
-            echo "post-relocate command \"\$s \$1\" failed with status \$status" >&2
-            exit \$status
-        fi
-    done
-    rm -rf "${SDKPATHNATIVE}/post-relocate-setup.d"
+       # Source top-level SDK env scripts in case they are needed for the relocate
+       # scripts.
+       for env_setup_script in ${env_dir}/environment-setup-*; do
+               . \$env_setup_script
+               status=\$?
+               if [ \$status != 0 ]; then
+                       echo "\$0: Failed to source \$env_setup_script with status \$status"
+                       exit \$status
+               fi
+
+               for s in ${SDKPATHNATIVE}/post-relocate-setup.d/*; do
+                       if [ ! -x \$s ]; then
+                               continue
+                       fi
+                       \$s "\$1"
+                       status=\$?
+                       if [ \$status != 0 ]; then
+                               echo "post-relocate command \"\$s \$1\" failed with status \$status" >&2
+                               exit \$status
+                       fi
+               done
+       done
+       rm -rf "${SDKPATHNATIVE}/post-relocate-setup.d"
 fi
 EOF
 }