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,46 +121,42 @@ 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 _, deps := range [3][]string{pkg.Depends, pkg.MakeDepends, pkg.CheckDepends} {
|
for _, pkg := range dc.Bases[_pkg.PackageBase] {
|
||||||
for _, _dep := range deps {
|
for _, deps := range [3][]string{pkg.Depends, pkg.MakeDepends, pkg.CheckDepends} {
|
||||||
dep := getNameFromDep(_dep)
|
for _, _dep := range deps {
|
||||||
|
dep := getNameFromDep(_dep)
|
||||||
|
|
||||||
aurpkg, exists := dt.Aur[dep]
|
aurpkg, exists := dt.Aur[dep]
|
||||||
if exists {
|
if exists {
|
||||||
_, ok := dc.Bases[aurpkg.PackageBase]
|
delete(dt.Aur, dep)
|
||||||
if !ok {
|
depCatagoriesRecursive(aurpkg, dc, dt, isMake, seen)
|
||||||
dc.Bases[aurpkg.PackageBase] = make([]*rpc.Pkg, 0)
|
|
||||||
}
|
|
||||||
dc.Bases[aurpkg.PackageBase] = append(dc.Bases[aurpkg.PackageBase], aurpkg)
|
|
||||||
|
|
||||||
delete(dt.Aur, dep)
|
if !seen.get(aurpkg.PackageBase) {
|
||||||
depCatagoriesRecursive(aurpkg, dc, dt, isMake, seen)
|
dc.Aur = append(dc.Aur, aurpkg)
|
||||||
|
seen.set(aurpkg.PackageBase)
|
||||||
|
}
|
||||||
|
|
||||||
if !seen.get(aurpkg.PackageBase) {
|
if isMake {
|
||||||
dc.Aur = append(dc.Aur, aurpkg)
|
dc.MakeOnly.set(aurpkg.Name)
|
||||||
seen.set(aurpkg.PackageBase)
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if isMake {
|
alpmpkg, exists := dt.Repo[dep]
|
||||||
dc.MakeOnly.set(aurpkg.Name)
|
if exists {
|
||||||
|
delete(dt.Repo, dep)
|
||||||
|
repoDepCatagoriesRecursive(alpmpkg, dc, dt, isMake)
|
||||||
|
|
||||||
|
if isMake {
|
||||||
|
dc.MakeOnly.set(alpmpkg.Name())
|
||||||
|
}
|
||||||
|
|
||||||
|
dc.Repo = append(dc.Repo, alpmpkg)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
isMake = true
|
||||||
alpmpkg, exists := dt.Repo[dep]
|
|
||||||
if exists {
|
|
||||||
delete(dt.Repo, dep)
|
|
||||||
repoDepCatagoriesRecursive(alpmpkg, dc, dt, isMake)
|
|
||||||
|
|
||||||
if isMake {
|
|
||||||
dc.MakeOnly.set(alpmpkg.Name())
|
|
||||||
}
|
|
||||||
|
|
||||||
dc.Repo = append(dc.Repo, alpmpkg)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
isMake = true
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user