-
-
Notifications
You must be signed in to change notification settings - Fork 365
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor and improve the upgrade menu #265
Conversation
|
||
fmt.Println(bold(cyan("::") + " Searching databases for updates...")) | ||
wg.Add(1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a small detail, here maybe wg.Add(2) and immediately launch the 2 go routines and then print Searching databases for updates and Searching AUR for updates.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So like?
wg.Add(2)
go func() {
repoUp, repoErr = upRepo(local)
wg.Done()
}()
go func() {
aurUp, aurErr = upAUR(remote, remoteNames, dt)
wg.Done()
}()
fmt.Println(bold(cyan("::") + " Searching databases for updates..."))
fmt.Println(bold(cyan("::") + " Searching AUR for updates..."))
if config.Devel {
wg.Add(1)
go func() {
develUp, develErr = upDevel(remote)
wg.Done()
}()
fmt.Println(bold(cyan("::") + " Checking development packages..."))
}
wg.Wait()
I much prefer how it is now, plus I always prefer telling the user you're about to do something before starting to do it. Either way there should be no performance difference in the code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was just to leave the main go routine a bit more entertained, I don't object to leaving it as is
Don't have many updates to test it on now, from a code perspective it seem good, I can try and update using this version for another day, but I don't see any issue with it |
Worked fine, on a mix of repo,aur and devel packages |
Before the goroutines in upList() were layed out like: upLists() |- - - upRepo() |- - - pAur() | - - - upDevel() Simplified by moving upDevel() from upAur() to upList(): upList() |- - - upRepo() |- - - upAur() |- - - upDevel() With the simpler layout it was easy to then remove some un need channel useage entirely and use WaitGroups in other places. Now if any of the three inner functions error, upList() will return a combined error instead of just printing the error and carrying on.
Sort accending instead of decending Sort by package name as well as repo name Sort AUR packages as well as repo packages
Previosly during `yay -Su` Yay would pass `pacman -S <packages that need upgrade>` to pacman. Instead pass `pacman -Su --ignore <number menu choices>` This allows yay to handle replaces and package downgrades `-Suu`
Fixes #218
The goroutine code is simpler now so hopefully I didn't make a dumb mistake but their still easy to mess up so I'd like a second opinion before merging.
See commits for a more detailed description.