conditionally set tar header on go >= 1.10
This commit is contained in:
parent
71dcc0f212
commit
742e366367
|
@ -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
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// We have to set the Format explicitly because of a bug in
|
// workaround for large archive formats on go >=1.10
|
||||||
// libarchive. This affects eg. the tar in macOS listing huge
|
setHeaderFormat(header)
|
||||||
// files with zero byte length.
|
|
||||||
header.Format = tar.FormatGNU
|
|
||||||
|
|
||||||
// We have to set the Name explicitly because it is supposed to
|
// We have to set the Name explicitly because it is supposed to
|
||||||
// be a relative path to the root. Otherwise, the tar ends up
|
// be a relative path to the root. Otherwise, the tar ends up
|
||||||
|
|
Loading…
Reference in New Issue