-
Notifications
You must be signed in to change notification settings - Fork 131
Open
Labels
Description
https://github.com/vbatts/tar-split/releases/tag/v0.12.0
Ran into this issue installing some other package (buf) that relies on this project just a few moments ago during a routine dependency (direct / indirect) bump.
estargz
uses this (now internal) package here:
stargz-snapshotter/estargz/estargz.go
Line 43 in 1281fc2
"github.com/vbatts/tar-split/archive/tar" |
stargz-snapshotter/estargz/estargz.go
Lines 872 to 895 in 1281fc2
var tw *tar.Writer | |
if !lossless { | |
tw = tar.NewWriter(dst) // use tar writer only when this isn't lossless mode. | |
} | |
tr := tar.NewReader(src) | |
if lossless { | |
tr.RawAccounting = true | |
} | |
prevOffset := w.cw.n | |
var prevOffsetUncompressed int64 | |
for { | |
h, err := tr.Next() | |
if err == io.EOF { | |
if lossless { | |
if remain := tr.RawBytes(); len(remain) > 0 { | |
// Collect the remaining null bytes. | |
// https://github.com/vbatts/tar-split/blob/80a436fd6164c557b131f7c59ed69bd81af69761/concept/main.go#L49-L53 | |
if _, err := dst.Write(remain); err != nil { | |
return err | |
} | |
} | |
} | |
break | |
} |
I'm hopeful, that the upstream archive/tar
is a drop in replacement if the use case can be covered by some of the discussion around TeeWriter or other workarounds for low-level byte access.