Commit 2215d09
authored
Fix: preserve symlinks in ZipArchive compress function (#8250)
This PR fixes #8248, by adding the `y` flag to the `zip` command that is
executed when archiving a package's sources for publication to a
registry on a non-Windows OS.
### Motivation:
Without this change, packages which contain symlinks in their sources
will produce invalid and potentially non-buildable archives when
publishing to a registry, since any symlinks are currently transformed
into duplicate files during the archive creation, instead of being
preserved.
### Modifications:
I've added the following flag to the `zip` call:
> -y store symbolic links as the link instead of the referenced file
I've additionally modified the associated `testCompress()` test case,
adding logic to ensure that symlinks are preserved correctly.
### Result:
With this change, the resulting zipfile that is uploaded to a registry
will contain symlinks consistent with the original package sources.1 parent 57a8f70 commit 2215d09
File tree
2 files changed
+9
-2
lines changed- Sources/Basics/Archiver
- Tests/BasicsTests/Archiver
2 files changed
+9
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
123 | | - | |
| 123 | + | |
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
| 121 | + | |
121 | 122 | | |
122 | 123 | | |
123 | 124 | | |
| |||
154 | 155 | | |
155 | 156 | | |
156 | 157 | | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
157 | 164 | | |
158 | 165 | | |
159 | | - | |
| 166 | + | |
0 commit comments