Skip to content

Commit

Permalink
Add support for zstd RPM files
Browse files Browse the repository at this point in the history
Signed-off-by: egibs <20933572+egibs@users.noreply.github.com>
  • Loading branch information
egibs committed Dec 19, 2024
1 parent 6e326a4 commit c08f3bf
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkg/archive/rpm.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"github.com/cavaliergopher/cpio"
"github.com/cavaliergopher/rpm"
"github.com/chainguard-dev/clog"
"github.com/klauspost/compress/zstd"
"github.com/ulikunitz/xz"
)

Expand Down Expand Up @@ -60,6 +61,12 @@ func ExtractRPM(ctx context.Context, d, f string) error {
return fmt.Errorf("failed to create xz reader: %w", err)
}
cr = cpio.NewReader(xzStream)
case "zstd":
zstdStream, err := zstd.NewReader(rpmFile)
if err != nil {
return fmt.Errorf("failed to create zstd reader: %w", err)
}
cr = cpio.NewReader(zstdStream)
default:
return fmt.Errorf("unsupported compression format: %s", compression)
}
Expand Down

0 comments on commit c08f3bf

Please sign in to comment.