Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var IsAlphabetic = regexp.MustCompile(`^[a-zA-Z/]+$`).MatchString
View Source
var PkgTemplate = "" + `{{.BlockComment}} from spack import * class {{.Name}}({{.PackageType}}): {{if .Description}}"""{{.Description}}"""{{end}} {{if .Homepage}}homepage = "{{.Homepage}}"{{end}} {{if gt (len .URL) 0}}url = "{{.URL}}"{{end}} ` + VersionTemplate + ` {{range $_, $entry := .Dependencies}} depends_on('{{$entry}}') {{end}} {{.BuildInstructions}} `
PkgTemplate is the common template to generate encoded spack package specs.
View Source
var VersionTemplate = "" +
`{{range $_, $entry := .Versions}} version('{{printVersion $entry}}'{{if $entry.Checksum}}, {{$entry.Checksum}}{{end}}{{if $entry.Branch}}, branch='{{$entry.Branch}}'{{end}}{{if $entry.Commit}}, commit='{{$entry.Commit}}'{{end}}{{if $entry.Submodules}}, submodules={{$entry.Submodules}}{{end}}{{if $entry.Expand}}, expand={{$entry.Expand}}{{end}}{{if $entry.URL}}, url='{{$entry.URL}}'{{end}}{{if $entry.Extension}}, extension='{{$entry.Extension}}'{{end}}{{if $entry.Tag}}, tag='{{$entry.Tag}}'{{end}})
{{end}}`
VersionTemplate is the defining template for how versions are written to generate an encoded spack package.
Functions ¶
This section is empty.
Types ¶
type Package ¶
type Package struct { Name string Description string BlockComment string Homepage string Maintainers []string URL string GitURL string PackageType string Dependencies []string LatestVersion Version Versions []Version BuildInstructions string }
Package is the internal struct representation of the Spack Package Spec.
func (*Package) AddVersion ¶
AddVersion appends a new version to the package struct if it doesn't already exist and sets the latest version to the input version if it is now the latest.
Click to show internal directories.
Click to hide internal directories.