Source packages metadata to update repository tree

This allows to generate trees with `create-repo` by just having
the metadata files, making tree(s) an optional requirement.
This commit is contained in:
Ettore Di Giacinto
2021-09-16 10:56:08 +02:00
parent 972421ae81
commit e4fff77d43
2 changed files with 35 additions and 1 deletions

View File

@@ -124,6 +124,8 @@ type Package interface {
JSON() ([]byte, error)
}
const PackageMetaSuffix = "metadata.yaml"
type Tree interface {
GetPackageSet() PackageDatabase
Prelude() string // A tree might have a prelude to be able to consume a tree
@@ -246,7 +248,7 @@ func (t *DefaultPackage) JSON() ([]byte, error) {
// GetMetadataFilePath returns the canonical name of an artifact metadata file
func (d *DefaultPackage) GetMetadataFilePath() string {
return d.GetFingerPrint() + ".metadata.yaml"
return fmt.Sprintf("%s.%s", d.GetFingerPrint(), PackageMetaSuffix)
}
// DefaultPackage represent a standard package definition