internal/rosa: resolve preset by name
All checks were successful
Test / Create distribution (push) Successful in 59s
Test / Sandbox (push) Successful in 2m40s
Test / Hakurei (push) Successful in 4m1s
Test / ShareFS (push) Successful in 3m56s
Test / Hpkg (push) Successful in 4m29s
Test / Sandbox (race detector) (push) Successful in 5m3s
Test / Hakurei (race detector) (push) Successful in 6m9s
Test / Flake checks (push) Successful in 1m37s

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2026-01-28 20:57:51 +09:00
parent cc403c96d8
commit e76bc6a13a
2 changed files with 60 additions and 103 deletions

View File

@@ -80,3 +80,56 @@ func (t Toolchain) Load(p PArtifact) pkg.Artifact {
})
return artifacts[t][p]
}
// ResolveName returns a [PArtifact] by name.
func (t Toolchain) ResolveName(name string) (p PArtifact, ok bool) {
p, ok = map[string]PArtifact{
"acl": ACL,
"attr": Attr,
"autoconf": Autoconf,
"bash": Bash,
"busybox": Busybox,
"cmake": CMake,
"coreutils": Coreutils,
"diffutils": Diffutils,
"fuse": Fuse,
"gawk": Gawk,
"gettext": Gettext,
"git": Git,
"go": Go,
"gperf": Gperf,
"hakurei": Hakurei,
"hakurei-dist": HakureiDist,
"iniconfig": IniConfig,
"kernel-headers": KernelHeaders,
"libXau": LibXau,
"libexpat": Libexpat,
"libseccomp": Libseccomp,
"libxml2": Libxml2,
"libffi": Libffi,
"libgd": Libgd,
"m4": M4,
"make": Make,
"meson": Meson,
"nss": NSS,
"nss-cacert": NSSCACert,
"ninja": Ninja,
"packaging": Packaging,
"patch": Patch,
"perl": Perl,
"pkg-config": PkgConfig,
"pluggy": Pluggy,
"pytest": PyTest,
"pygments": Pygments,
"python": Python,
"rsync": Rsync,
"setuptools": Setuptools,
"wayland": Wayland,
"wayland-protocols": WaylandProtocols,
"xcb": XCB,
"xcb-proto": XCBProto,
"xproto": Xproto,
"zlib": Zlib,
}[name]
return
}