From e76bc6a13aa9d2d1f6695c3ddcda1267cafe9ae6 Mon Sep 17 00:00:00 2001 From: Ophestra Date: Wed, 28 Jan 2026 20:57:51 +0900 Subject: internal/rosa: resolve preset by name Signed-off-by: Ophestra --- internal/rosa/all.go | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) (limited to 'internal') diff --git a/internal/rosa/all.go b/internal/rosa/all.go index 18ea6cad..3b9ccb74 100644 --- a/internal/rosa/all.go +++ b/internal/rosa/all.go @@ -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 +} -- cgit v1.3.1