dnf-json: make independent from the host
We must avoid depending on the host's state in any way. This achieves isolation in the following ways: - rather than the default config file /dev/null is used - rather than sharing the host persistent state dir a temporary one is used and thrown away for each call - the module_platform_id is set explicitly per supported distro, rather than taken from /etc/os-release. Optionally, the cache directory can be configured, as we may want to keep this separate from the host, if for no other reason than accounting. However, the cache appears to be well-behaved, so we can keep sharing it between calls (or even with the host). This speeds up things considerably, so this is definitely what we want. Signed-off-by: Tom Gundersen <teg@jklm.no>
This commit is contained in:
parent
b6d9268810
commit
cdd1912e78
5 changed files with 81 additions and 68 deletions
|
|
@ -30,10 +30,10 @@ func NewRPMMDMock(fixture Fixture) rpmmd.RPMMD {
|
|||
return &rpmmdMock{Fixture: fixture}
|
||||
}
|
||||
|
||||
func (r *rpmmdMock) FetchPackageList(repos []rpmmd.RepoConfig) (rpmmd.PackageList, map[string]string, error) {
|
||||
func (r *rpmmdMock) FetchPackageList(repos []rpmmd.RepoConfig, modulePlatformID string) (rpmmd.PackageList, map[string]string, error) {
|
||||
return r.Fixture.fetchPackageList.ret, r.Fixture.fetchPackageList.checksums, r.Fixture.fetchPackageList.err
|
||||
}
|
||||
|
||||
func (r *rpmmdMock) Depsolve(specs, excludeSpecs []string, repos []rpmmd.RepoConfig, clean bool) ([]rpmmd.PackageSpec, map[string]string, error) {
|
||||
func (r *rpmmdMock) Depsolve(specs, excludeSpecs []string, repos []rpmmd.RepoConfig, modulePlatformID string, clean bool) ([]rpmmd.PackageSpec, map[string]string, error) {
|
||||
return r.Fixture.depsolve.ret, r.Fixture.fetchPackageList.checksums, r.Fixture.depsolve.err
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue