pkg

package
v0.2.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 26, 2021 License: Apache-2.0 Imports: 4 Imported by: 1

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

func (p *Package) AddVersion(input Version)

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.

type Version

type Version struct {
	Value      version.Version
	Checksum   string
	Commit     string
	URL        string
	Tag        string
	Branch     string
	Submodules string
	Expand     string
	Extension  string
}

Version is the internal struct representation of the Spack Package Version

func (*Version) Compare

func (v *Version) Compare(other Version) int

Compare checks a version against another and returns if the other version is smaller than (-1), equal to (0) or greater than (1) the current version.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL