conditionally set tar header on go >= 1.10

pull/6085/head
Matthew Hooker 8 years ago
parent 71dcc0f212
commit 742e366367
No known key found for this signature in database
GPG Key ID: 7B5F933D9CE8C6A1

@ -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…
Cancel
Save