From 5fe42f13d77f2903419619b103bbea7c829ac17f Mon Sep 17 00:00:00 2001 From: Jacob Kozol Date: Tue, 12 Nov 2019 11:38:31 +0100 Subject: [PATCH] blueprint: add change object for blueprints Add a struct to store changes made to a blueprint. Each change contains a commit which is a hex string based off of an sha1 hash, a message describing the change, a revision which will usually be null, a timestamp, and the blueprint at the time of the change. --- internal/blueprint/blueprint.go | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/internal/blueprint/blueprint.go b/internal/blueprint/blueprint.go index 3d1016666..a7f9a0477 100644 --- a/internal/blueprint/blueprint.go +++ b/internal/blueprint/blueprint.go @@ -22,6 +22,14 @@ type Blueprint struct { Customizations *Customizations `json:"customizations,omitempty"` } +type Change struct { + Commit string `json:"commit"` + Message string `json:"message"` + Revision *string `json:"revision"` + Timestamp string `json:"timestamp"` + Blueprint Blueprint `json:"-"` +} + // A Package specifies an RPM package. type Package struct { Name string `json:"name"` @@ -42,10 +50,10 @@ func (b *Blueprint) GetKernelCustomization() *KernelCustomization { } func (p Package) ToNameVersion() string { - // Omit version to prevent all packages with prefix of name to be installed - if p.Version == "*" { - return p.Name - } + // Omit version to prevent all packages with prefix of name to be installed + if p.Version == "*" { + return p.Name + } - return p.Name + "-" + p.Version + return p.Name + "-" + p.Version }