forked from rosa/hakurei
internal/rosa: key-value type
This type is used very frequently. The new type is much easier to type and can receive helper methods eventually if needed. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
@@ -37,6 +37,9 @@ func mustDecode(s string) pkg.Checksum {
|
||||
return pkg.MustDecode(s)
|
||||
}
|
||||
|
||||
// KV is a key-value pair of strings.
|
||||
type KV [2]string
|
||||
|
||||
var (
|
||||
// AbsUsrSrc is the conventional directory to place source code under.
|
||||
AbsUsrSrc = fhs.AbsUsr.Append("src")
|
||||
@@ -364,7 +367,7 @@ func (t Toolchain) NewPatchedSource(
|
||||
name, version string,
|
||||
source pkg.Artifact,
|
||||
passthrough bool,
|
||||
patches ...[2]string,
|
||||
patches ...KV,
|
||||
) pkg.Artifact {
|
||||
if passthrough && len(patches) == 0 {
|
||||
return source
|
||||
@@ -446,7 +449,7 @@ type PackageAttr struct {
|
||||
ScriptEarly string
|
||||
|
||||
// Passed to [Toolchain.NewPatchedSource].
|
||||
Patches [][2]string
|
||||
Patches []KV
|
||||
// Kind of source artifact.
|
||||
SourceKind int
|
||||
|
||||
|
||||
Reference in New Issue
Block a user