Skip to content

Commit

Permalink
Add support for zstd deb packages (#23657)
Browse files Browse the repository at this point in the history
  • Loading branch information
dantecatalfamo authored Nov 11, 2024
1 parent 2d8ebb4 commit ddbf6f1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions changes/22891-zstd-deb-packages
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Add support for deb packages compressed with zstd
8 changes: 8 additions & 0 deletions pkg/file/deb.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"strings"

"github.com/blakesmith/ar"
"github.com/klauspost/compress/zstd"
"github.com/xi2/xz"
)

Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit ddbf6f1

Please sign in to comment.