Skip to content

Commit

Permalink
gen-manifests: add excluded packages via exclude: prefix in mock
Browse files Browse the repository at this point in the history
This commit adds excluded packages to the generated manifest when
the `gen-manifests` command is run in the `mockDepsolve()` mode.

This allows us to compare the generated otk and images manifests
with more confidence.
  • Loading branch information
mvo5 committed Sep 18, 2024
1 parent abf8d87 commit fbde851
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions cmd/gen-manifests/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,20 @@ func mockDepsolve(packageSets map[string][]rpmmd.PackageSet, repos []rpmmd.RepoC
}
specSet = append(specSet, spec)
}
for _, excludeName := range pkgSet.Exclude {
pkgName := fmt.Sprintf("exclude:%s", excludeName)
checksum := fmt.Sprintf("%x", sha256.Sum256([]byte(pkgName)))
spec := rpmmd.PackageSpec{
Name: pkgName,
Epoch: 0,
Version: "0",
Release: "0",
Arch: "noarch",
RemoteLocation: fmt.Sprintf("https://example.com/repo/packages/%s", pkgName),
Checksum: "sha256:" + checksum,
}
specSet = append(specSet, spec)
}
}
depsolvedSets[name] = specSet
repoSets[name] = repos
Expand Down

0 comments on commit fbde851

Please sign in to comment.