Skip to content

Commit

Permalink
fix: Only generete toInstall tree if s.Strategy is InstallOne
Browse files Browse the repository at this point in the history
Signed-off-by: Víctor Cuadrado Juan <[email protected]>
  • Loading branch information
viccuad committed Jul 9, 2021
1 parent d6f0693 commit aa54fd2
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions internal/solver/solver.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,10 +210,12 @@ func (s *Solver) GeneratePkgSets(wantedPkg *pkg.Pkg) {
}
}

s.PkgResultSet.ToInstall = &PkgTree{}
visited := map[string]bool{}
// add dependencies of wantedPkg
s.PkgResultSet.ToInstall = s.recBuildTree(wantedPkg, visited)
if s.Strategy == InstallOne {
s.PkgResultSet.ToInstall = &PkgTree{}
visited := map[string]bool{}
// add dependencies of wantedPkg
s.PkgResultSet.ToInstall = s.recBuildTree(wantedPkg, visited)
}
}

func (s *Solver) recBuildTree(p *pkg.Pkg, visited map[string]bool) *PkgTree {
Expand Down

0 comments on commit aa54fd2

Please sign in to comment.