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