rpmmd/FetchMedata: fix checksum map

This is currently only used in tests. We broke backwards compatibility
when we split the repo name and the repo id. The tests expect this to be
indexed by name, not index.

This should probably be reworked or dropped, for now revert to the old
behavior.

Signed-off-by: Tom Gundersen <teg@jklm.no>
This commit is contained in:
Tom Gundersen 2020-05-27 21:47:37 +02:00
parent 04e3d0ba7b
commit d9ae1f9204

View file

@ -341,7 +341,11 @@ func (r *rpmmdImpl) FetchMetadata(repos []RepoConfig, modulePlatformID string, a
sort.Slice(reply.Packages, func(i, j int) bool {
return reply.Packages[i].Name < reply.Packages[j].Name
})
return reply.Packages, reply.Checksums, err
checksums := make(map[string]string)
for i, repo := range repos {
checksums[repo.Name] = reply.Checksums[strconv.Itoa(i)]
}
return reply.Packages, checksums, err
}
func (r *rpmmdImpl) Depsolve(specs, excludeSpecs []string, repos []RepoConfig, modulePlatformID, arch string) ([]PackageSpec, map[string]string, error) {