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>
This commit is contained in:
parent
5756d9fafb
commit
b751ec137d
|
@ -143,11 +143,20 @@ else
|
||||||
target_sdk_dir=$(readlink -m $target_sdk_dir)
|
target_sdk_dir=$(readlink -m $target_sdk_dir)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
printf "You are about to install the SDK to \"$target_sdk_dir\". Proceed[Y/n]?"
|
if [ -e "$target_sdk_dir/environment-setup-${REAL_MULTIMACH_TARGET_SYS}" ]; then
|
||||||
|
echo "The directory \"$target_sdk_dir\" already contains a SDK for this architecture."
|
||||||
|
printf "If you continue, existing files will be overwritten! Proceed[y/N]?"
|
||||||
|
|
||||||
|
default_answer="n"
|
||||||
|
else
|
||||||
|
printf "You are about to install the SDK to \"$target_sdk_dir\". Proceed[Y/n]?"
|
||||||
|
|
||||||
|
default_answer="y"
|
||||||
|
fi
|
||||||
read answer
|
read answer
|
||||||
|
|
||||||
if [ "$answer" = "" ]; then
|
if [ "$answer" = "" ]; then
|
||||||
answer="y"
|
answer="$default_answer"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$answer" != "Y" -a "$answer" != "y" ]; then
|
if [ "$answer" != "Y" -a "$answer" != "y" ]; then
|
||||||
|
@ -188,7 +197,7 @@ find $native_sysroot -type f -exec file '{}' \;|grep ":.*ASCII.*text"|cut -d':'
|
||||||
|
|
||||||
# change all symlinks pointing to ${SDKPATH}
|
# change all symlinks pointing to ${SDKPATH}
|
||||||
for l in $(find $native_sysroot -type l); do
|
for l in $(find $native_sysroot -type l); do
|
||||||
ln -sf $(readlink $l|sed -e "s:$DEFAULT_INSTALL_DIR:$target_sdk_dir:") $l
|
ln -sfn $(readlink $l|sed -e "s:$DEFAULT_INSTALL_DIR:$target_sdk_dir:") $l
|
||||||
done
|
done
|
||||||
|
|
||||||
echo done
|
echo done
|
||||||
|
|
Loading…
Reference in New Issue