Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Jguer committed Sep 6, 2022
1 parent 95e7542 commit 0aa18d6
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 12 deletions.
4 changes: 2 additions & 2 deletions local_install.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ func installLocalPKGBUILD(
fmt.Println(graph)
// aurCache.DebugInfo()

// topoSorted := graph.TopoSortedLayers()
// fmt.Println(topoSorted, len(topoSorted))
topoSorted := graph.TopoSortedLayers()
fmt.Println(topoSorted, len(topoSorted))

return nil
}
27 changes: 17 additions & 10 deletions pkg/dep/depGraph.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,14 @@ func NewGrapher(dbExecutor db.Executor, aurCache *metadata.AURCache, fullGraph,

func (g *Grapher) GraphFromSrcInfo(pkgbuild *gosrc.Srcinfo) (*topo.Graph[string], error) {
graph := topo.New[string]()

aurPkgs, err := makeAURPKGFromSrcinfo(g.dbExecutor, pkgbuild)
if err != nil {
return nil, err
}

for _, pkg := range aurPkgs {
pkg := pkg
depSlice := ComputeCombinedDepList(&pkg, false, false)
g.addNodes(graph, pkg.Name, depSlice)
}
Expand Down Expand Up @@ -78,6 +80,7 @@ func (g *Grapher) addNodes(
text.Warnln(depName, parentPkgName, err)
}
}

continue
}

Expand Down Expand Up @@ -212,16 +215,20 @@ func makeAURPKGFromSrcinfo(dbExecutor db.Executor, srcInfo *gosrc.Srcinfo) ([]au
Version: srcInfo.Version(),
Description: pkg.Pkgdesc,
URL: pkg.URL,
Depends: append(archStringToString(alpmArch, pkg.Depends), archStringToString(alpmArch, srcInfo.Package.Depends)...),
MakeDepends: archStringToString(alpmArch, srcInfo.PackageBase.MakeDepends),
CheckDepends: archStringToString(alpmArch, srcInfo.PackageBase.CheckDepends),
Conflicts: append(archStringToString(alpmArch, pkg.Conflicts), archStringToString(alpmArch, srcInfo.Package.Conflicts)...),
Provides: append(archStringToString(alpmArch, pkg.Provides), archStringToString(alpmArch, srcInfo.Package.Provides)...),
Replaces: append(archStringToString(alpmArch, pkg.Replaces), archStringToString(alpmArch, srcInfo.Package.Replaces)...),
OptDepends: []string{},
Groups: pkg.Groups,
License: pkg.License,
Keywords: []string{},
Depends: append(archStringToString(alpmArch, pkg.Depends),
archStringToString(alpmArch, srcInfo.Package.Depends)...),
MakeDepends: archStringToString(alpmArch, srcInfo.PackageBase.MakeDepends),
CheckDepends: archStringToString(alpmArch, srcInfo.PackageBase.CheckDepends),
Conflicts: append(archStringToString(alpmArch, pkg.Conflicts),
archStringToString(alpmArch, srcInfo.Package.Conflicts)...),
Provides: append(archStringToString(alpmArch, pkg.Provides),
archStringToString(alpmArch, srcInfo.Package.Provides)...),
Replaces: append(archStringToString(alpmArch, pkg.Replaces),
archStringToString(alpmArch, srcInfo.Package.Replaces)...),
OptDepends: []string{},
Groups: pkg.Groups,
License: pkg.License,
Keywords: []string{},
})
}

Expand Down

0 comments on commit 0aa18d6

Please sign in to comment.