diff options
author | Laurentiu Palcu <laurentiu.palcu@intel.com> | 2012-11-26 11:31:40 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-12-03 13:52:06 +0000 |
commit | b751ec137d0228b40a90e9e32b24f5cb5732225b (patch) | |
tree | 600752cfbf832b7cd4ce8b268772b3ecdecfbf88 | |
parent | 5756d9fafb524f1830ccca7587b8e064900d449b (diff) | |
download | poky-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.bbclass | 15 |
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) |
144 | fi | 144 | fi |
145 | 145 | ||
146 | printf "You are about to install the SDK to \"$target_sdk_dir\". Proceed[Y/n]?" | 146 | if [ -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" | ||
151 | else | ||
152 | printf "You are about to install the SDK to \"$target_sdk_dir\". Proceed[Y/n]?" | ||
153 | |||
154 | default_answer="y" | ||
155 | fi | ||
147 | read answer | 156 | read answer |
148 | 157 | ||
149 | if [ "$answer" = "" ]; then | 158 | if [ "$answer" = "" ]; then |
150 | answer="y" | 159 | answer="$default_answer" |
151 | fi | 160 | fi |
152 | 161 | ||
153 | if [ "$answer" != "Y" -a "$answer" != "y" ]; then | 162 | if [ "$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} |
190 | for l in $(find $native_sysroot -type l); do | 199 | for 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 |
192 | done | 201 | done |
193 | 202 | ||
194 | echo done | 203 | echo done |