1
0
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:
2026-06-04 18:37:07 +09:00
parent 76c1fb84c8
commit db69dcf0be
9 changed files with 78 additions and 164 deletions
+10 -5
View File
@@ -21,8 +21,13 @@ const (
)
// newTar wraps [pkg.NewHTTPGetTar] with a simpler function signature.
func newTar(url, checksum string, compression uint32) pkg.Artifact {
return pkg.NewHTTPGetTar(nil, url, mustDecode(checksum), compression)
func newTar(url, checksum string, compress uint32) pkg.Artifact {
return pkg.NewTar(
pkg.NewDecompress(
pkg.NewHTTPGet(nil, url, mustDecode(checksum)),
compress,
),
)
}
// newFromCPAN is a helper for downloading release from CPAN.
@@ -32,7 +37,7 @@ func newFromCPAN(author, name, version, checksum string) pkg.Artifact {
author[:1]+"/"+author[:2]+"/"+author+"/"+
name+"-"+version+".tar.gz",
checksum,
pkg.TarGzip,
pkg.Gzip,
)
}
@@ -43,7 +48,7 @@ func newFromGitLab(domain, suffix, ref, checksum string) pkg.Artifact {
ref+"/"+path.Base(suffix)+"-"+
strings.ReplaceAll(ref, "/", "-")+".tar.bz2",
checksum,
pkg.TarBzip2,
pkg.Bzip2,
)
}
@@ -53,7 +58,7 @@ func newFromGitHub(suffix, tag, checksum string) pkg.Artifact {
"https://github.com/"+suffix+
"/archive/refs/tags/"+tag+".tar.gz",
checksum,
pkg.TarGzip,
pkg.Gzip,
)
}