Skip to content

Commit

Permalink
Merge branch 'main' into fix-tar-gz-edge-case
Browse files Browse the repository at this point in the history
  • Loading branch information
egibs authored Dec 20, 2024
2 parents 0acf3ec + fcd1105 commit f270dc9
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 f270dc9

Please sign in to comment.