Propagate Checksum and CompressionType when building ArtifactIndex

Refers to #33
This commit is contained in:
Ettore Di Giacinto
2019-12-30 16:32:05 +01:00
parent ea27ada6c0
commit d48f510f14

View File

@@ -51,7 +51,15 @@ func (i ArtifactIndex) CleanPath() ArtifactIndex {
newIndex := ArtifactIndex{}
for _, n := range i {
art := n.(*PackageArtifact)
newIndex = append(newIndex, &PackageArtifact{Path: path.Base(n.GetPath()), SourceAssertion: art.SourceAssertion, CompileSpec: art.CompileSpec, Dependencies: art.Dependencies})
// FIXME: This is a dup and makes difficult to add attributes to artifacts
newIndex = append(newIndex, &PackageArtifact{
Path: path.Base(n.GetPath()),
SourceAssertion: art.SourceAssertion,
CompileSpec: art.CompileSpec,
Dependencies: art.Dependencies,
CompressionType: art.CompressionType,
Checksums: art.Checksums,
})
}
return newIndex
//Update if exists, otherwise just create