1
1
Fork 0
mirror of https://github.com/goreleaser/nfpm synced 2024-04-20 05:03:58 +02:00

manually set the header attribute。 (#359)

Co-authored-by: zhanglei.sec <zhanglei.sec@bytedance.com>
Co-authored-by: Dj Gilcrease <d.gilcrease@f5.com>
This commit is contained in:
PaiPai 2021-10-13 08:02:26 +08:00 committed by GitHub
parent 8230209c40
commit d1ff1af396
Signed by: GitHub
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View File

@ -472,6 +472,8 @@ func copyToTarAndDigest(file *files.Content, tw *tar.Writer, sizep *int64) error
}
header.Name = files.ToNixPath(file.Destination[1:])
header.Uname = file.FileInfo.Owner
header.Gname = file.FileInfo.Group
if err = newItemInsideTarGz(tw, contents, header); err != nil {
return err
}

View File

@ -345,6 +345,8 @@ func copyToTarAndDigest(file *files.Content, tw *tar.Writer, md5w io.Writer) (in
}
header.Format = tar.FormatGNU
header.Name = normalizePath(file.Destination)
header.Uname = file.FileInfo.Owner
header.Gname = file.FileInfo.Group
if err := tw.WriteHeader(header); err != nil {
return 0, fmt.Errorf("cannot write header of %s to data.tar.gz: %w", file.Source, err)
}