mirror of
https://github.com/Jguer/yay
synced 2024-09-14 13:51:12 +00:00
Correctly mark packages as dependencies
Previously Installing repo targets and repo dependencies of aur targets
was done in two steps.
doing `yay -S repo1 repo2 aur1 aur2` would lead to yay calling
`pacman -S repo1 repo2`. Then after we find all the dependencies of the
aur packages we call `pacman -S --asdeps <all repo dependencies>`. This
was an easy way to correctly mark dependencies. Since 005635b4
Both
these calls were merged into one command but dependency marking was
forgoten about.
Now correctly mark the dependencies through `pacman -D`
This commit is contained in:
parent
83a4b9a44f
commit
0b6e4e0872
36
install.go
36
install.go
|
@ -16,7 +16,7 @@ import (
|
||||||
// Install handles package installs
|
// Install handles package installs
|
||||||
func install(parser *arguments) error {
|
func install(parser *arguments) error {
|
||||||
removeMake := false
|
removeMake := false
|
||||||
aur, repo, err := packageSlices(parser.targets.toSlice())
|
aurTargets, repoTargets, err := packageSlices(parser.targets.toSlice())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,7 @@ func install(parser *arguments) error {
|
||||||
var dc *depCatagories
|
var dc *depCatagories
|
||||||
|
|
||||||
//fmt.Println(greenFg(arrow), greenFg("Resolving Dependencies"))
|
//fmt.Println(greenFg(arrow), greenFg("Resolving Dependencies"))
|
||||||
requestTargets := append(aur, repo...)
|
requestTargets := append(aurTargets, repoTargets...)
|
||||||
|
|
||||||
//remotenames: names of all non repo packages on the system
|
//remotenames: names of all non repo packages on the system
|
||||||
_, _, _, remoteNames, err := filterPackages()
|
_, _, _, remoteNames, err := filterPackages()
|
||||||
|
@ -45,7 +45,7 @@ func install(parser *arguments) error {
|
||||||
requestTargets = append(requestTargets, remoteNames...)
|
requestTargets = append(requestTargets, remoteNames...)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(aur) > 0 || parser.existsArg("u", "sysupgrade") && len(remoteNames) > 0 {
|
if len(aurTargets) > 0 || parser.existsArg("u", "sysupgrade") && len(remoteNames) > 0 {
|
||||||
fmt.Println(boldCyanFg("::"), boldFg("Querying AUR..."))
|
fmt.Println(boldCyanFg("::"), boldFg("Querying AUR..."))
|
||||||
}
|
}
|
||||||
dt, err := getDepTree(requestTargets)
|
dt, err := getDepTree(requestTargets)
|
||||||
|
@ -105,9 +105,9 @@ func install(parser *arguments) error {
|
||||||
arguments.addTarget(pkg.Name())
|
arguments.addTarget(pkg.Name())
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, pkg := range repo {
|
//for _, pkg := range repoTargets {
|
||||||
arguments.addTarget(pkg)
|
//arguments.addTarget(pkg)
|
||||||
}
|
//}
|
||||||
|
|
||||||
if len(dc.Aur) == 0 && len(arguments.targets) == 0 {
|
if len(dc.Aur) == 0 && len(arguments.targets) == 0 {
|
||||||
fmt.Println("There is nothing to do")
|
fmt.Println("There is nothing to do")
|
||||||
|
@ -124,6 +124,24 @@ func install(parser *arguments) error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Error installing repo packages.")
|
return fmt.Errorf("Error installing repo packages.")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
depArguments := makeArguments()
|
||||||
|
depArguments.addArg("D", "asdeps")
|
||||||
|
|
||||||
|
for _, pkg := range dc.Repo {
|
||||||
|
depArguments.addTarget(pkg.Name())
|
||||||
|
}
|
||||||
|
for _, pkg := range repoTargets {
|
||||||
|
depArguments.delTarget(pkg)
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(depArguments.targets) > 0 {
|
||||||
|
err = passToPacman(depArguments)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if hasAur {
|
if hasAur {
|
||||||
|
@ -208,8 +226,12 @@ func install(parser *arguments) error {
|
||||||
|
|
||||||
oldValue := config.NoConfirm
|
oldValue := config.NoConfirm
|
||||||
config.NoConfirm = true
|
config.NoConfirm = true
|
||||||
passToPacman(removeArguments)
|
err = passToPacman(removeArguments)
|
||||||
config.NoConfirm = oldValue
|
config.NoConfirm = oldValue
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if config.CleanAfter {
|
if config.CleanAfter {
|
||||||
|
|
Loading…
Reference in a new issue