diff --git a/changes/22891-zstd-deb-packages b/changes/22891-zstd-deb-packages new file mode 100644 index 000000000000..f523dd62720d --- /dev/null +++ b/changes/22891-zstd-deb-packages @@ -0,0 +1 @@ +- Add support for deb packages compressed with zstd diff --git a/pkg/file/deb.go b/pkg/file/deb.go index 35d5881342b0..b8e4fb28649b 100644 --- a/pkg/file/deb.go +++ b/pkg/file/deb.go @@ -15,6 +15,7 @@ import ( "strings" "github.com/blakesmith/ar" + "github.com/klauspost/compress/zstd" "github.com/xi2/xz" ) @@ -101,6 +102,13 @@ func parseControl(r io.Reader, ext string) (name, version string, err error) { if err != nil { return "", "", fmt.Errorf("failed to create xz reader: %w", err) } + case ".zst": + zr, err := zstd.NewReader(r) + if err != nil { + return "", "", fmt.Errorf("failed to create zstd reader: %w", err) + } + defer zr.Close() + r = zr case "": // uncompressed default: