From f191db24948393143f5d62b860475aa708bb02e2 Mon Sep 17 00:00:00 2001 From: Timofey Solomko Date: Fri, 21 Oct 2022 21:27:47 +0300 Subject: [PATCH] [swcomp] Use saved (relative) paths when extracting symlinks --- Sources/swcomp/Containers/CommonFunctions.swift | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Sources/swcomp/Containers/CommonFunctions.swift b/Sources/swcomp/Containers/CommonFunctions.swift index 39fcd607..a44a395c 100644 --- a/Sources/swcomp/Containers/CommonFunctions.swift +++ b/Sources/swcomp/Containers/CommonFunctions.swift @@ -102,11 +102,10 @@ func writeFile(_ entry: T, _ outputURL: URL, _ verbose: Bool) } guard destinationPath != nil else { swcompExit(.containerSymLinkDestPath(entryName)) } - let endURL = entryFullURL.deletingLastPathComponent().appendingPathComponent(destinationPath!) if verbose { - print("l: \(entryName) -> \(endURL.path)") + print("l: \(entryName) -> \(destinationPath!)") } - try fileManager.createSymbolicLink(atPath: entryFullURL.path, withDestinationPath: endURL.path) + try fileManager.createSymbolicLink(atPath: entryFullURL.path, withDestinationPath: destinationPath!) // We cannot apply attributes to symbolic link. return } else if entry.info.type == .regular {