(value string)
| 832 | } |
| 833 | |
| 834 | func (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. |
| 857 | func (b *BuildConfig) expandOptions() { |
no outgoing calls
no test coverage detected