Skip to content

Commit 64b3934

Browse files
kateinoigakukunAnka
authored andcommitted
[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.
1 parent b0c7a7d commit 64b3934

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

utils/darwin-installer-scripts/postinstall

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313

1414
INSTALLED_TOOLCHAIN=$2
1515

16-
ln -fs "${INSTALLED_TOOLCHAIN}" "${INSTALLED_TOOLCHAIN%/*}/swift-latest.xctoolchain"
16+
ln -fhs "${INSTALLED_TOOLCHAIN}" "${INSTALLED_TOOLCHAIN%/*}/swift-latest.xctoolchain"

0 commit comments

Comments
 (0)