mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[installer] Do not follow an existing symbolic link when overwriting
Without `-h` option, `ln` command makes a symbolic link under the existing link destination like `Toolchains/swift-DEVELOPMENT-SNAPSHOT-XX.xctoolchain/`. ``` $ ln -fs swift-DEVELOPMENT-SNAPSHOT-XX.xctoolchain swift-latest.xctoolchain $ ln -fs swift-DEVELOPMENT-SNAPSHOT-YY.xctoolchain swift-latest.xctoolchain $ tree |-- swift-DEVELOPMENT-SNAPSHOT-XX.xctoolchain | |-- swift-DEVELOPMENT-SNAPSHOT-YY.xctoolchain -> swift-DEVELOPMENT-SNAPSHOT-YY.xctoolchain |-- swift-DEVELOPMENT-SNAPSHOT-YY.xctoolchain |-- swift-latest.xctoolchain -> swift-DEVELOPMENT-SNAPSHOT-XX.xctoolchain ``` So we should not follow the existing symbolic link even if it already exists.
This commit is contained in:
@@ -13,4 +13,4 @@
|
||||
|
||||
INSTALLED_TOOLCHAIN=$2
|
||||
|
||||
ln -fs "${INSTALLED_TOOLCHAIN}" "${INSTALLED_TOOLCHAIN%/*}/swift-latest.xctoolchain"
|
||||
ln -fhs "${INSTALLED_TOOLCHAIN}" "${INSTALLED_TOOLCHAIN%/*}/swift-latest.xctoolchain"
|
||||
|
||||
Reference in New Issue
Block a user