Skip to content

Commit

Permalink
Added fix for checkRecursively depCheck
Browse files Browse the repository at this point in the history
  • Loading branch information
ericm committed Jun 26, 2020
1 parent ad3c6f3 commit 33cff8a
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions sync/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ type depBuild struct {

var depCheckMap = make(map[string]bool)

func checkRecursively(pkg *PkgBuild, out, outMake, outOpts []PkgBuild) {
func checkRecursively(pkg *PkgBuild, out, outMake, outOpts *[]PkgBuild) {
newDeps, newMakeDeps, newOptDeps, _ := pkg.depCheck()
for _, dep := range newDeps {
depCheckMap[dep.name] = true
Expand All @@ -646,9 +646,9 @@ func checkRecursively(pkg *PkgBuild, out, outMake, outOpts []PkgBuild) {
for _, dep := range newOptDeps {
depCheckMap[dep.name] = true
}
out = append(out, newDeps...)
outMake = append(outMake, newMakeDeps...)
outOpts = append(outOpts, newOptDeps...)
*out = append(*out, newDeps...)
*outMake = append(*outMake, newMakeDeps...)
*outOpts = append(*outOpts, newOptDeps...)
}

// depCheck for AUR dependencies
Expand Down Expand Up @@ -751,8 +751,8 @@ func (pkg *PkgBuild) depCheck() ([]PkgBuild, []PkgBuild, []PkgBuild, error) {
case pkg := <-buildChannel:
out = append(out, *pkg)
// Map dependency tree
if !pkg.pacman && !depCheckMap[pkg.name] {
checkRecursively(pkg, out, outMake, outOpts)
if !pkg.pacman {
checkRecursively(pkg, &out, &outMake, &outOpts)
}
case err := <-errChannel:
if err != nil {
Expand All @@ -768,7 +768,7 @@ func (pkg *PkgBuild) depCheck() ([]PkgBuild, []PkgBuild, []PkgBuild, error) {
outMake = append(outMake, *pkg)
// Map dependency tree
if !pkg.pacman && !depCheckMap[pkg.name] {
checkRecursively(pkg, out, outMake, outOpts)
checkRecursively(pkg, &out, &outMake, &outOpts)
}
case err := <-errChannelM:
if err != nil {
Expand Down

0 comments on commit 33cff8a

Please sign in to comment.