diff options
| author | Ophestra <cat@gensokyo.uk> | 2026-01-07 20:18:28 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2026-01-07 20:18:28 +0900 |
| commit | 7ea4e8b643dbe4931e3cb3072d180ee066a28dd1 (patch) | |
| tree | 819d54a4b6b5a76b18ff4bdc1a9066b90395ef9e /internal/pkg/tar.go | |
| parent | 5eefebcb48ac1be682ea50a23c544df93b04dc07 (diff) | |
internal/pkg: support tarball compressed via bzip2
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/pkg/tar.go')
| -rw-r--r-- | internal/pkg/tar.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/internal/pkg/tar.go b/internal/pkg/tar.go index 1ce30383..33f26f3a 100644 --- a/internal/pkg/tar.go +++ b/internal/pkg/tar.go @@ -3,6 +3,7 @@ package pkg import ( "archive/tar" "bytes" + "compress/bzip2" "compress/gzip" "context" "encoding/binary" @@ -21,6 +22,8 @@ const ( TarUncompressed = iota // TarGzip denotes a tarball compressed via [gzip]. TarGzip + // TarBzip2 denotes a tarball compressed via [bzip2]. + TarBzip2 ) // A tarArtifact is an [Artifact] unpacking a tarball backed by a [File]. @@ -100,6 +103,10 @@ func (a *tarArtifact) Cure(c *CureContext) (err error) { } break + case TarBzip2: + tr = io.NopCloser(bzip2.NewReader(tr)) + break + default: return os.ErrInvalid } |
