mirror of
https://github.com/Jguer/yay.git
synced 2025-12-08 00:05:04 -05:00
fix GraphFromTarget bug where empty DB would be used as identifier
This commit is contained in:
parent
481c63db91
commit
2805252365
@ -126,16 +126,17 @@ func (g *Grapher) GraphFromTargets(ctx context.Context,
|
|||||||
|
|
||||||
switch target.DB {
|
switch target.DB {
|
||||||
case "": // unspecified db
|
case "": // unspecified db
|
||||||
if g.dbExecutor.SyncPackage(target.Name) != nil {
|
if pkg := g.dbExecutor.SyncPackage(target.Name); pkg != nil {
|
||||||
graph.AddNode(target.Name)
|
dbName := pkg.DB().Name()
|
||||||
|
graph.AddNode(pkg.Name())
|
||||||
g.ValidateAndSetNodeInfo(graph, target.Name, &topo.NodeInfo[*InstallInfo]{
|
g.ValidateAndSetNodeInfo(graph, target.Name, &topo.NodeInfo[*InstallInfo]{
|
||||||
Color: colorMap[Explicit],
|
Color: colorMap[Explicit],
|
||||||
Background: bgColorMap[AUR],
|
Background: bgColorMap[Sync],
|
||||||
Value: &InstallInfo{
|
Value: &InstallInfo{
|
||||||
Source: Sync,
|
Source: Sync,
|
||||||
Reason: Explicit,
|
Reason: Explicit,
|
||||||
Version: target.Version,
|
Version: pkg.Version(),
|
||||||
SyncDBName: &target.DB,
|
SyncDBName: &dbName,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -149,7 +150,7 @@ func (g *Grapher) GraphFromTargets(ctx context.Context,
|
|||||||
graph.AddNode(target.Name)
|
graph.AddNode(target.Name)
|
||||||
g.ValidateAndSetNodeInfo(graph, target.Name, &topo.NodeInfo[*InstallInfo]{
|
g.ValidateAndSetNodeInfo(graph, target.Name, &topo.NodeInfo[*InstallInfo]{
|
||||||
Color: colorMap[Explicit],
|
Color: colorMap[Explicit],
|
||||||
Background: bgColorMap[AUR],
|
Background: bgColorMap[Sync],
|
||||||
Value: &InstallInfo{
|
Value: &InstallInfo{
|
||||||
Source: Sync,
|
Source: Sync,
|
||||||
Reason: Explicit,
|
Reason: Explicit,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user