mirror of
https://github.com/Jguer/yay.git
synced 2024-11-06 17:17:22 +01:00
Merge pull request #187 from Morganamilo/fix#10
Better dep checking on split packages
This commit is contained in:
commit
238d3a0b6c
@ -52,6 +52,15 @@ func getDepCatagories(pkgs []string, dt *depTree) (*depCatagories, error) {
|
|||||||
dc := makeDependCatagories()
|
dc := makeDependCatagories()
|
||||||
seen := make(stringSet)
|
seen := make(stringSet)
|
||||||
|
|
||||||
|
for _, pkg := range dt.Aur {
|
||||||
|
_, ok := dc.Bases[pkg.PackageBase]
|
||||||
|
if !ok {
|
||||||
|
dc.Bases[pkg.PackageBase] = make([]*rpc.Pkg, 0)
|
||||||
|
}
|
||||||
|
dc.Bases[pkg.PackageBase] = append(dc.Bases[pkg.PackageBase], pkg)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
for _, pkg := range pkgs {
|
for _, pkg := range pkgs {
|
||||||
dep := getNameFromDep(pkg)
|
dep := getNameFromDep(pkg)
|
||||||
alpmpkg, exists := dt.Repo[dep]
|
alpmpkg, exists := dt.Repo[dep]
|
||||||
@ -69,11 +78,6 @@ func getDepCatagories(pkgs []string, dt *depTree) (*depCatagories, error) {
|
|||||||
seen.set(aurpkg.PackageBase)
|
seen.set(aurpkg.PackageBase)
|
||||||
}
|
}
|
||||||
|
|
||||||
_, ok := dc.Bases[aurpkg.PackageBase]
|
|
||||||
if !ok {
|
|
||||||
dc.Bases[aurpkg.PackageBase] = make([]*rpc.Pkg, 0)
|
|
||||||
}
|
|
||||||
dc.Bases[aurpkg.PackageBase] = append(dc.Bases[aurpkg.PackageBase], aurpkg)
|
|
||||||
delete(dt.Aur, dep)
|
delete(dt.Aur, dep)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -117,19 +121,14 @@ func repoDepCatagoriesRecursive(pkg *alpm.Package, dc *depCatagories, dt *depTre
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
func depCatagoriesRecursive(pkg *rpc.Pkg, dc *depCatagories, dt *depTree, isMake bool, seen stringSet) {
|
func depCatagoriesRecursive(_pkg *rpc.Pkg, dc *depCatagories, dt *depTree, isMake bool, seen stringSet) {
|
||||||
|
for _, pkg := range dc.Bases[_pkg.PackageBase] {
|
||||||
for _, deps := range [3][]string{pkg.Depends, pkg.MakeDepends, pkg.CheckDepends} {
|
for _, deps := range [3][]string{pkg.Depends, pkg.MakeDepends, pkg.CheckDepends} {
|
||||||
for _, _dep := range deps {
|
for _, _dep := range deps {
|
||||||
dep := getNameFromDep(_dep)
|
dep := getNameFromDep(_dep)
|
||||||
|
|
||||||
aurpkg, exists := dt.Aur[dep]
|
aurpkg, exists := dt.Aur[dep]
|
||||||
if exists {
|
if exists {
|
||||||
_, ok := dc.Bases[aurpkg.PackageBase]
|
|
||||||
if !ok {
|
|
||||||
dc.Bases[aurpkg.PackageBase] = make([]*rpc.Pkg, 0)
|
|
||||||
}
|
|
||||||
dc.Bases[aurpkg.PackageBase] = append(dc.Bases[aurpkg.PackageBase], aurpkg)
|
|
||||||
|
|
||||||
delete(dt.Aur, dep)
|
delete(dt.Aur, dep)
|
||||||
depCatagoriesRecursive(aurpkg, dc, dt, isMake, seen)
|
depCatagoriesRecursive(aurpkg, dc, dt, isMake, seen)
|
||||||
|
|
||||||
@ -158,6 +157,7 @@ func depCatagoriesRecursive(pkg *rpc.Pkg, dc *depCatagories, dt *depTree, isMake
|
|||||||
}
|
}
|
||||||
isMake = true
|
isMake = true
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func getDepTree(pkgs []string) (*depTree, error) {
|
func getDepTree(pkgs []string) (*depTree, error) {
|
||||||
|
Loading…
Reference in New Issue
Block a user