forked from rosa/hakurei
internal/pkg: remove tar built-in decompressor
This is replaced by decompressArtifact and is no longer necessary. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
+16
-8
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user