lib

package
v0.0.0-...-93a3304 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2020 License: GPL-3.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CompressionTypes = map[string]CompressionType{
	"gz": CompressionType{
		Suffix: "gz",
		Flag:   "-z",
	},
	"xz": CompressionType{
		Suffix: "xz",
		Flag:   "-J",
	},
	"zstd": CompressionType{
		Suffix: "zst",
		Flag:   "--zstd",
	},
	"bz2": CompressionType{
		Suffix: "bz2",
		Flag:   "-j",
	},
}
View Source
var PossibleDirectives = []string{
	"NoFileCheck",
	"ReasonFor",
}
View Source
var PossibleKeys = []string{
	"Name:",
	"Summary:",
	"License:",
	"URL:",
	"Requires:",
	"BuildRequires:",
	"Recommends:",
	"Version:",
	"Release:",
	"Epoch:",
	"EpochVersionRelease:",
	"EpoVerRel:",
	"EVR:",
	"Provides:",
	"Conflicts:",
	"Replaces:",
	"Obsoletes:",
	"ExclusiveArch:",
	"Groups:",
	"CheckRequires:",
}

Functions

func Build

func Build(pathToRecipe string) error

Build : Build a specfile, generating an Arch package.

func ClosestString

func ClosestString(stringToLookForMatches string, stringsToLookIn []string) string

func Enter

func Enter()

Enter : Main function of alpmbuild's command line interface

func IsStdoutTty

func IsStdoutTty() bool

func LevenshteinDistance

func LevenshteinDistance(string1, string2 string) int

Implementation taken from https://gist.github.com/andrei-m/982927#gistcomment-1931258 and https://github.com/agnivade/levenshtein/blob/master/levenshtein.go. Both implementations are licensed under the MIT license.

Types

type BadNameReason

type BadNameReason int
const (
	ValidName BadNameReason = iota
	EmptyName
	StartsWithHyphen
	StartsWithDot
	NonASCIICharacter
	NonAlphanumericCharacters
)

type BuildInfo

type BuildInfo struct {
	System struct {
		Arch      string
		OS        string
		GoVersion string
		Packages  []libalpm.Package
	}
	SpecFile      []byte
	Package       PackageContext
	ParentPackage *PackageContext `json:",omitempty"`
}

type CompressionType

type CompressionType struct {
	Suffix string
	Flag   string
}

type HashType

type HashType int
const (
	NoHash HashType = iota
	Sha1Hash
	Sha224Hash
	Sha256Hash
	Sha384Hash
	Sha512Hash
	Md5Hash
)

type PackageContext

type PackageContext struct {
	// Single-value fields with relatively standard behaviour.
	Name    string `macro:"name" key:"name:" pkginfo:"pkgname"`
	Summary string `macro:"summary" key:"summary:" pkginfo:"pkgdesc"`
	License string `macro:"license" key:"license:" pkginfo:"pkglicense"`
	URL     string `macro:"url" key:"url:" pkginfo:"url"`
	Epoch   string `macro:"epoch" key:"epoch:" pkginfo:"epoch"`

	// Array fields with relatively standard behaviour.
	Requires      []string `keyArray:"requires:" pkginfo:"depend"`
	CheckRequires []string `keyArray:"checkrequires:" pkginfo:"checkdepend"`
	Recommends    []string `keyArray:"recommends:" pkginfo:"optdepend"`
	BuildRequires []string `keyArray:"buildrequires:" pkginfo:"makedepend"`
	Provides      []string `keyArray:"provides:" pkginfo:"provides"`
	Conflicts     []string `keyArray:"conflicts:" pkginfo:"conflicts"`
	Replaces      []string `keyArray:"replaces: obsoletes:" pkginfo:"replaces"`
	Groups        []string `keyArray:"groups:" pkginfo:"group"`
	ExclusiveArch []string `keyArray:"exclusivearch:"`

	// Nonstandard single-value fields
	Version string `macro:"version" key:"version:"`
	Release string `macro:"release" key:"release:"`

	// Nonstandard array fields
	Sources   []Source
	Patches   []Source
	Changelog []string
	Files     []string
	Backup    []string `keyArray:"backup:" pkginfo:"backup"`

	// Command fields
	Commands struct {
		Prepare []string
		Build   []string
		Install []string
		Check   []string
	}

	// Scriptlet fields
	Scriptlets struct {
		PreInstall  []string
		PostInstall []string
		PreUpgrade  []string
		PostUpgrade []string
		PreRemove   []string
		PostRemove  []string
	}

	// Other fields
	IsSubpackage bool

	Subpackages map[string]PackageContext
	Reasons     map[string]string
	// contains filtered or unexported fields
}

func ParsePackage

func ParsePackage(data string) PackageContext

func (PackageContext) BuildPackage

func (pkg PackageContext) BuildPackage()

func (PackageContext) CheckArch

func (pkg PackageContext) CheckArch()

func (PackageContext) ClearTimestamps

func (pkg PackageContext) ClearTimestamps()

func (PackageContext) CompressPackage

func (pkg PackageContext) CompressPackage()

func (PackageContext) GenerateBuildInfo

func (pkg PackageContext) GenerateBuildInfo()

func (PackageContext) GenerateCHANGELOG

func (pkg PackageContext) GenerateCHANGELOG()

func (PackageContext) GenerateINSTALL

func (pkg PackageContext) GenerateINSTALL()

func (PackageContext) GenerateMTree

func (pkg PackageContext) GenerateMTree()

func (PackageContext) GeneratePackageInfo

func (pkg PackageContext) GeneratePackageInfo()

func (PackageContext) GenerateSourcePackage

func (pkg PackageContext) GenerateSourcePackage()

func (PackageContext) GetNevr

func (pkg PackageContext) GetNevr() string

func (PackageContext) GetNevra

func (pkg PackageContext) GetNevra() string

func (*PackageContext) InheritFromParent

func (pkg *PackageContext) InheritFromParent()

func (PackageContext) PackageRoot

func (pkg PackageContext) PackageRoot() string

func (PackageContext) TakeFilesFromParent

func (pkg PackageContext) TakeFilesFromParent()

func (PackageContext) VerifyFiles

func (pkg PackageContext) VerifyFiles()

type Source

type Source struct {
	URL             string
	Rename          string
	Md5             string
	Sha1            string
	Sha256          string
	Sha224          string
	Sha384          string
	Sha512          string
	GPGSignatureURL string
	GPGKeys         []string
	GPGKeyservers   []string
}

type Stage

type Stage int
const (
	NoStage Stage = iota + 1
	PrepareStage
	BuildStage
	InstallStage
	CheckStage
	FileStage

	PreInstallStage
	PostInstallStage
	PreUpgradeStage
	PostUpgradeStage
	PreRemoveStage
	PostRemoveStage

	ChangelogStage

	IfTrueStage
	IfFalseStage
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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