summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorHongxu Jia <hongxu.jia@windriver.com>2013-03-11 14:55:44 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-04-23 13:00:52 +0100
commit192d249b31e2506688833b146f596449b4a54184 (patch)
treedbcbe2bd66e91bd77001a0b06f06030229a3af49 /meta
parentc84d6fb67d2943e30ec05ca6701c39a685565b05 (diff)
downloadpoky-192d249b31e2506688833b146f596449b4a54184.tar.gz
populate_sdk_base: tarball installer: SDK overwrite warning
This patch contains two fixes: * if the user wants to install the SDK in a directory that already contains a SDK for the same architecture, a warning will be shown; * when the symbolic links are relocated use -n option. Otherwise, symbolic links to existing directories will be created in the directory itself; Cherry-pick commit b751ec137d0228b40a90e9e32b24f5cb5732225b [YOCTO #3401] (From OE-Core rev: c3b00f18f24c5ff48981ea3645a58cf48eaa94aa) Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/populate_sdk_base.bbclass15
1 files changed, 12 insertions, 3 deletions
diff --git a/meta/classes/populate_sdk_base.bbclass b/meta/classes/populate_sdk_base.bbclass
index a1c45ad70a..5e4ed51d4a 100644
--- a/meta/classes/populate_sdk_base.bbclass
+++ b/meta/classes/populate_sdk_base.bbclass
@@ -132,11 +132,20 @@ else
132 target_sdk_dir=$(readlink -m $target_sdk_dir) 132 target_sdk_dir=$(readlink -m $target_sdk_dir)
133fi 133fi
134 134
135printf "You are about to install the SDK to \"$target_sdk_dir\". Proceed[Y/n]?" 135if [ -e "$target_sdk_dir/environment-setup-${REAL_MULTIMACH_TARGET_SYS}" ]; then
136 echo "The directory \"$target_sdk_dir\" already contains a SDK for this architecture."
137 printf "If you continue, existing files will be overwritten! Proceed[y/N]?"
138
139 default_answer="n"
140else
141 printf "You are about to install the SDK to \"$target_sdk_dir\". Proceed[Y/n]?"
142
143 default_answer="y"
144fi
136read answer 145read answer
137 146
138if [ "$answer" = "" ]; then 147if [ "$answer" = "" ]; then
139 answer="y" 148 answer="$default_answer"
140fi 149fi
141 150
142if [ "$answer" != "Y" -a "$answer" != "y" ]; then 151if [ "$answer" != "Y" -a "$answer" != "y" ]; then
@@ -176,7 +185,7 @@ find $native_sysroot -type f -exec file '{}' \;|grep ":.*ASCII.*text"|cut -d':'
176 185
177# change all symlinks pointing to ${SDKPATH} 186# change all symlinks pointing to ${SDKPATH}
178for l in $(find $native_sysroot -type l); do 187for l in $(find $native_sysroot -type l); do
179 ln -sf $(readlink $l|sed -e "s:$DEFAULT_INSTALL_DIR:$target_sdk_dir:") $l 188 ln -sfn $(readlink $l|sed -e "s:$DEFAULT_INSTALL_DIR:$target_sdk_dir:") $l
180done 189done
181 190
182echo done 191echo done