MCPcopy Create free account
hub / github.com/celer-pkg/celer / parseBuildSystem

Method parseBuildSystem

buildsystems/buildconfig.go:834–854  ·  view source on GitHub ↗
(value string)

Source from the content-addressed store, hash-verified

832}
833
834func (b BuildConfig) parseBuildSystem(value string) (name, version string, hasVersion bool, err error) {
835 value = strings.TrimSpace(value)
836 if value == "" {
837 return "", "", false,
838 fmt.Errorf("build_system is empty for %s, it should be one of %s",
839 b.PortConfig.PortFile, strings.Join(buildSystems, ", "))
840 }
841
842 if strings.Count(value, "@") > 1 {
843 return "", "", false, fmt.Errorf("invalid build_system format: %q", value)
844 }
845
846 name, version, hasVersion = strings.Cut(value, "@")
847 name = strings.TrimSpace(name)
848 version = strings.TrimSpace(version)
849 if hasVersion && version == "" {
850 return "", "", false, fmt.Errorf("invalid build_system format: %q", value)
851 }
852
853 return name, version, hasVersion, nil
854}
855
856// expandOptions Replace placeholders with real paths and values.
857func (b *BuildConfig) expandOptions() {

Callers 2

ValidateMethod · 0.95
InitBuildSystemMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected