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.
This commit is contained in:
parent
11eb0b5226
commit
5fe42f13d7
1 changed files with 13 additions and 5 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue