summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurentiu Palcu <laurentiu.palcu@intel.com>2012-11-26 11:31:40 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-12-03 13:52:06 +0000
commitb751ec137d0228b40a90e9e32b24f5cb5732225b (patch)
tree600752cfbf832b7cd4ce8b268772b3ecdecfbf88
parent5756d9fafb524f1830ccca7587b8e064900d449b (diff)
downloadpoky-b751ec137d0228b40a90e9e32b24f5cb5732225b.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; [YOCTO #3401] (From OE-Core rev: cd035f170a2448b9ebcf0cfac5d4c0fa472b7049) Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-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 ac34c32b52..f1fcde6f44 100644
--- a/meta/classes/populate_sdk_base.bbclass
+++ b/meta/classes/populate_sdk_base.bbclass
@@ -143,11 +143,20 @@ else
143 target_sdk_dir=$(readlink -m $target_sdk_dir) 143 target_sdk_dir=$(readlink -m $target_sdk_dir)
144fi 144fi
145 145
146printf "You are about to install the SDK to \"$target_sdk_dir\". Proceed[Y/n]?" 146if [ -e "$target_sdk_dir/environment-setup-${REAL_MULTIMACH_TARGET_SYS}" ]; then
147 echo "The directory \"$target_sdk_dir\" already contains a SDK for this architecture."
148 printf "If you continue, existing files will be overwritten! Proceed[y/N]?"
149
150 default_answer="n"
151else
152 printf "You are about to install the SDK to \"$target_sdk_dir\". Proceed[Y/n]?"
153
154 default_answer="y"
155fi
147read answer 156read answer
148 157
149if [ "$answer" = "" ]; then 158if [ "$answer" = "" ]; then
150 answer="y" 159 answer="$default_answer"
151fi 160fi
152 161
153if [ "$answer" != "Y" -a "$answer" != "y" ]; then 162if [ "$answer" != "Y" -a "$answer" != "y" ]; then
@@ -188,7 +197,7 @@ find $native_sysroot -type f -exec file '{}' \;|grep ":.*ASCII.*text"|cut -d':'
188 197
189# change all symlinks pointing to ${SDKPATH} 198# change all symlinks pointing to ${SDKPATH}
190for l in $(find $native_sysroot -type l); do 199for l in $(find $native_sysroot -type l); do
191 ln -sf $(readlink $l|sed -e "s:$DEFAULT_INSTALL_DIR:$target_sdk_dir:") $l 200 ln -sfn $(readlink $l|sed -e "s:$DEFAULT_INSTALL_DIR:$target_sdk_dir:") $l
192done 201done
193 202
194echo done 203echo done