aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/rosa/state.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2026-06-04 18:37:07 +0900
committerOphestra <cat@gensokyo.uk>2026-06-04 18:54:43 +0900
commitdb69dcf0be0c1be4e3187027fa4199538013e76d (patch)
tree78513e0ec30c375af15270852d551f326c7f663f /internal/rosa/state.go
parent76c1fb84c87ba12a22b64f7c471a92603365837f (diff)
internal/pkg: remove tar built-in decompressor
This is replaced by decompressArtifact and is no longer necessary. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/rosa/state.go')
-rw-r--r--internal/rosa/state.go24
1 files changed, 16 insertions, 8 deletions
diff --git a/internal/rosa/state.go b/internal/rosa/state.go
index d55610fe..feb06f82 100644
--- a/internal/rosa/state.go
+++ b/internal/rosa/state.go
@@ -433,10 +433,11 @@ func (s *S) getFrame() azalea.Frame {
identDefault := k("default")
identArch := unique.Make(azalea.Ident(s.arch))
+ const compressOffset = 1 << 8
enumCompress := map[unique.Handle[azalea.Ident]]any{
- k("uncompressed"): uint32(pkg.TarUncompressed),
- k("gzip"): uint32(pkg.TarGzip),
- k("bzip2"): uint32(pkg.TarBzip2),
+ k("uncompressed"): 0,
+ k("gzip"): pkg.Gzip + compressOffset,
+ k("bzip2"): pkg.Bzip2 + compressOffset,
}
s.frame.Val = map[unique.Handle[azalea.Ident]]any{
@@ -609,15 +610,19 @@ func (s *S) getFrame() azalea.Frame {
args azalea.FArgs,
) (v any, set bool, err error) {
var url, checksum string
- var compress uint32
+ var _compress int
if err = args.Apply(map[unique.Handle[azalea.Ident]]any{
k("url"): &url,
k("checksum"): &checksum,
- k("compress"): &compress,
+ k("compress"): &_compress,
}); err != nil {
return
}
- v = pkg.NewHTTPGetTar(nil, url, mustDecode(checksum), compress)
+ f := pkg.NewHTTPGet(nil, url, mustDecode(checksum))
+ if _compress != 0 {
+ f = pkg.NewDecompress(f, uint32(_compress-compressOffset))
+ }
+ v = pkg.NewTar(f)
set = true
return
}, V: enumCompress},
@@ -744,7 +749,10 @@ func (s *S) getFrame() azalea.Frame {
v = newFromGitHubRelease(suffix, tag, name, checksum, compress)
set = true
return
- }, V: enumCompress},
+ }, V: map[unique.Handle[azalea.Ident]]any{
+ k("gzip"): uint32(pkg.Gzip),
+ k("bzip2"): uint32(pkg.Bzip2),
+ }},
// high-level helpers
@@ -1275,7 +1283,7 @@ func (s *S) SetSource(fsys fs.FS) error {
Description: "hakurei source tree (current)",
Version: "1.0.0-CURRENT",
Exclude: true,
- }, pkg.NewTar(a, pkg.TarGzip)
+ }, pkg.NewTar(pkg.NewDecompress(a, pkg.Gzip))
}),
)
s.DropCaches(s.Arch(), s.Flags())