diff options
author | Simon Hausmann <simon.hausmann@qt.io> | 2020-01-29 18:43:11 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2020-01-29 23:33:24 +0100 |
commit | db33107c91b3b616d62b98f544ba5f43e048451a (patch) | |
tree | 8664c0f9831779c672c297d8daa9970c73631553 | |
parent | e79eaa4e7abb42a528fadc806ceaeed2e321b4e4 (diff) | |
download | qtqa-db33107c91b3b616d62b98f544ba5f43e048451a.tar.gz |
Fix module dependencies after qt5.git changes
When starting a new round of updates, consider the dependency
information (required, optional) from qt5.git as authoritative, instead
of re-using an existing dependencies.yaml file. This fixes the situation
where after changes to qt5.git a previous optional dependency is not
included in the default set anymore.
Change-Id: Ic7a095951a960c3c491f85dcaf3f495d0932e2d7
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
-rw-r--r-- | src/qtmoduleupdater/module.go | 41 |
1 files changed, 19 insertions, 22 deletions
diff --git a/src/qtmoduleupdater/module.go b/src/qtmoduleupdater/module.go index 0a0e6bf..a335028 100644 --- a/src/qtmoduleupdater/module.go +++ b/src/qtmoduleupdater/module.go @@ -193,35 +193,32 @@ func NewModule(moduleName string, branch string, qt5Modules map[string]*submodul return nil, fmt.Errorf("could not fetch repo tip %s of %s: %s", headRef, moduleName, err) } - yamlDependencies, _ := readDependenciesYAML(repoPath, repo, moduleTipCommit) - if yamlDependencies == nil { - yamlDependencies = &YAMLDependencies{} - yamlDependencies.Dependencies = make(map[string]*YAMLModule) + yamlDependencies := &YAMLDependencies{} + yamlDependencies.Dependencies = make(map[string]*YAMLModule) - subModule, ok := qt5Modules[moduleName] - if !ok { - return nil, fmt.Errorf("could not find %s in .gitmodules in qt5.git", moduleName) - } + subModule, ok := qt5Modules[moduleName] + if !ok { + return nil, fmt.Errorf("could not find %s in .gitmodules in qt5.git", moduleName) + } - populateDependencies := func(required bool, dependencies []string) { - for _, dependency := range dependencies { - _, knownModule := qt5Modules[dependency] - if !required && !knownModule { - continue - } + populateDependencies := func(required bool, dependencies []string) { + for _, dependency := range dependencies { + _, knownModule := qt5Modules[dependency] + if !required && !knownModule { + continue + } - var yamlModule YAMLModule - yamlModule.Required = required - yamlModule.Ref = string(subModule.headCommit) + var yamlModule YAMLModule + yamlModule.Required = required + yamlModule.Ref = string(subModule.headCommit) - yamlDependencies.Dependencies[dependency] = &yamlModule - } + yamlDependencies.Dependencies[dependency] = &yamlModule } - - populateDependencies(true, subModule.requiredDependencies) - populateDependencies(false, subModule.optionalDependencies) } + populateDependencies(true, subModule.requiredDependencies) + populateDependencies(false, subModule.optionalDependencies) + result := &Module{} result.RepoPath = repoPath result.Branch = branch |