Merge pull request #6085 from hashicorp/tar-go
conditionally set tar header on go >= 1.10
This commit is contained in:
commit
b97a36a5c7
|
@ -0,0 +1,9 @@
|
|||
// +build !go1.10
|
||||
|
||||
package vagrant
|
||||
|
||||
import "archive/tar"
|
||||
|
||||
func setHeaderFormat(header *tar.Header) {
|
||||
// no-op
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
// +build go1.10
|
||||
|
||||
package vagrant
|
||||
|
||||
import "archive/tar"
|
||||
|
||||
func setHeaderFormat(header *tar.Header) {
|
||||
// We have to set the Format explicitly because of a bug in
|
||||
// libarchive. This affects eg. the tar in macOS listing huge
|
||||
// files with zero byte length.
|
||||
header.Format = tar.FormatGNU
|
||||
}
|
|
@ -126,10 +126,8 @@ func DirToBox(dst, dir string, ui packer.Ui, level int) error {
|
|||
return err
|
||||
}
|
||||
|
||||
// We have to set the Format explicitly because of a bug in
|
||||
// libarchive. This affects eg. the tar in macOS listing huge
|
||||
// files with zero byte length.
|
||||
header.Format = tar.FormatGNU
|
||||
// workaround for large archive formats on go >=1.10
|
||||
setHeaderFormat(header)
|
||||
|
||||
// We have to set the Name explicitly because it is supposed to
|
||||
// be a relative path to the root. Otherwise, the tar ends up
|
||||
|
|
Loading…
Reference in New Issue