mirror of
https://github.com/Jguer/yay
synced 2024-10-31 04:12:51 +00:00
Fixes no updates hang. Refers #39
This commit is contained in:
parent
6165007f2c
commit
4e67864662
2 changed files with 10 additions and 7 deletions
15
actions.go
15
actions.go
|
@ -39,15 +39,16 @@ func upgradePkgs(flags []string) error {
|
||||||
aurUp, repoUp, err := upgrade.List()
|
aurUp, repoUp, err := upgrade.List()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
} else if len(aurUp)+len(repoUp) == 0 {
|
||||||
|
fmt.Println("\nthere is nothing to do")
|
||||||
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(aurUp)+len(repoUp) > 0 {
|
sort.Sort(repoUp)
|
||||||
sort.Sort(repoUp)
|
fmt.Printf("\x1b[1;34;1m:: \x1b[0m\x1b[1m%d Packages to upgrade.\x1b[0m\n", len(aurUp)+len(repoUp))
|
||||||
fmt.Printf("\x1b[1;34;1m:: \x1b[0m\x1b[1m%d Packages to upgrade.\x1b[0m\n", len(aurUp)+len(repoUp))
|
upgrade.Print(len(aurUp), repoUp)
|
||||||
upgrade.Print(len(aurUp), repoUp)
|
upgrade.Print(0, aurUp)
|
||||||
upgrade.Print(0, aurUp)
|
fmt.Print("\x1b[32mEnter packages you don't want to upgrade.\x1b[0m\nNumbers: ")
|
||||||
fmt.Print("\x1b[32mEnter packages you don't want to upgrade.\x1b[0m\nNumbers: ")
|
|
||||||
}
|
|
||||||
reader := bufio.NewReader(os.Stdin)
|
reader := bufio.NewReader(os.Stdin)
|
||||||
|
|
||||||
numberBuf, overflow, err := reader.ReadLine()
|
numberBuf, overflow, err := reader.ReadLine()
|
||||||
|
|
|
@ -140,12 +140,14 @@ func List() (aurUp Slice, repoUp Slice, err error) {
|
||||||
aurC := make(chan []Upgrade)
|
aurC := make(chan []Upgrade)
|
||||||
errC := make(chan error)
|
errC := make(chan error)
|
||||||
|
|
||||||
|
fmt.Println("\x1b[1;36;1m::\x1b[0m\x1b[1m Searching databases for updates...\x1b[0m")
|
||||||
go func() {
|
go func() {
|
||||||
repoUpList, err := repo(local)
|
repoUpList, err := repo(local)
|
||||||
errC <- err
|
errC <- err
|
||||||
repoC <- repoUpList
|
repoC <- repoUpList
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
fmt.Println("\x1b[1;36;1m::\x1b[0m\x1b[1m Searching AUR for updates...\x1b[0m")
|
||||||
go func() {
|
go func() {
|
||||||
aurUpList, err := aur(remote, remoteNames)
|
aurUpList, err := aur(remote, remoteNames)
|
||||||
errC <- err
|
errC <- err
|
||||||
|
|
Loading…
Reference in a new issue