diff options
| author | Hongxu Jia <hongxu.jia@windriver.com> | 2013-03-11 14:55:44 +0800 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-04-23 13:00:52 +0100 |
| commit | 192d249b31e2506688833b146f596449b4a54184 (patch) | |
| tree | dbcbe2bd66e91bd77001a0b06f06030229a3af49 /meta | |
| parent | c84d6fb67d2943e30ec05ca6701c39a685565b05 (diff) | |
| download | poky-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.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 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) |
| 133 | fi | 133 | fi |
| 134 | 134 | ||
| 135 | printf "You are about to install the SDK to \"$target_sdk_dir\". Proceed[Y/n]?" | 135 | if [ -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" | ||
| 140 | else | ||
| 141 | printf "You are about to install the SDK to \"$target_sdk_dir\". Proceed[Y/n]?" | ||
| 142 | |||
| 143 | default_answer="y" | ||
| 144 | fi | ||
| 136 | read answer | 145 | read answer |
| 137 | 146 | ||
| 138 | if [ "$answer" = "" ]; then | 147 | if [ "$answer" = "" ]; then |
| 139 | answer="y" | 148 | answer="$default_answer" |
| 140 | fi | 149 | fi |
| 141 | 150 | ||
| 142 | if [ "$answer" != "Y" -a "$answer" != "y" ]; then | 151 | if [ "$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} |
| 178 | for l in $(find $native_sysroot -type l); do | 187 | for 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 |
| 180 | done | 189 | done |
| 181 | 190 | ||
| 182 | echo done | 191 | echo done |
