1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-01-06 03:13:48 +02:00
goreleaser/pkg/archive
Ori Rawlings 19ab124f1b
fix: retain symlinks added to zip archives (#3585)
<!--

Hi, thanks for contributing!

Please make sure you read our CONTRIBUTING guide.

Also, add tests and the respective documentation changes as well.

-->


<!-- If applied, this commit will... -->

fixes #3584 

When following the reproduction steps in #3584 I now get the following
contents for the zip archive:
```
$ goreleaser --snapshot --skip-publish
...
$ (mkdir thezip && cd thezip && unzip ../dist/test_0.0.0-SNAPSHOT-none_darwin_amd64.zip) && ls -lR thezip
Archive:  ../dist/test_0.0.0-SNAPSHOT-none_darwin_amd64.zip
  inflating: a/x                     -> ../x 
  inflating: a/x2                    -> x 
  inflating: x                       
  inflating: test                    
finishing deferred symbolic links:
  a/x                    -> ../x
  a/x2                   -> x
total 1640
drwxr-xr-x  4 orawlings  staff     128 Nov 22 16:19 a
-rwxr-xr-x  1 orawlings  staff  833104 Nov 22 16:19 test
-rw-r--r--  1 orawlings  staff       2 Nov 22 15:32 x

thezip/a:
total 0
lrwxr-xr-x  1 orawlings  staff  4 Nov 22 16:19 x -> ../x
lrwxr-xr-x  1 orawlings  staff  1 Nov 22 16:19 x2 -> x
```

<!-- Why is this change being made? -->

I'm using goreleaser for a project that packages multiple binaries in
zip archives. We also include symlinks within the zip archives to give
some of the binaries an alternate (usually shorter) spelling so they are
easier to invoke on the command line.

This brings the zip archive behavior regarding symlinks in line with
tar.gz and tar archives.

<!-- # Provide links to any relevant tickets, URLs or other resources
-->
2022-11-29 22:05:18 -03:00
..
gzip feat: faster archiving with pgzip (#2941) 2022-02-27 13:16:08 -03:00
tar fix: improve tar error handling 2022-08-22 22:06:20 -03:00
targz docs: add more podman details 2022-11-08 23:15:12 -03:00
tarxz test: reducing test ouput (#3222) 2022-07-04 21:13:10 -03:00
testdata feat: allow to use .tar as archive format 2021-08-31 23:09:18 -03:00
zip fix: retain symlinks added to zip archives (#3585) 2022-11-29 22:05:18 -03:00
archive_test.go refactor: improve archive pipe (#3100) 2022-05-11 21:54:28 -03:00
archive.go refactor: improve archive pipe (#3100) 2022-05-11 21:54:28 -03:00