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`
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.
-Qu now has AUR support, it functions identically to `-Pu` and may replace
it in the futre.
Aditionally the pacman options `-n` and `-m` are also supported to
filter out native and non native packages. Other flags are not supported
currently.
Using any other `-Q` will fallback to Pacman.
Now that install() no longer relies on packageSlices() we can drop the
use of FindSatisfier() so that only direct package names are understood,
this is how pacman -Si works.
This also fixes a small issue where `yay -Si mysql` would fail. This is
because two repo packages provide `mysql`. This causes Yay to not bother
checking the AUR even though there is a package in the AUR called `mysql`
When pkgbuilds are built by makepkg, if the pkgbuild's arch=() array
does not include the current carch set in makepkg.conf, makepkg will
fail to build the package.
Now, Yay detects if a pkgbuild does not support the arch set in
pacman.conf Yay will ask the user about this and ask them if they want
to build anyway, passing `--ignorearch` to makepkg.`
Note that Yay will check against the arch set in pacman.conf which is
what pacman uses to only allow installs of package of that arch. makepkg
will still use carch set in makepkg.conf to build packages. These two
values are expected to be the same otherwise Yay will fail.
The on disk .srcinfo is needed for this as the user should be asked pre
source download. This and pgp checking both use the on disk .srcinfo so
it is no longer a one off. Store the 'stale' srcinfos so they can be
accesed by both functions.
Fix typo where adding to has instead of depStrings
Error correcly when missing packages
Also handle cases where a package is provided multiple times. If one
package provies `foo=1` and another provides `foo=2` before the latter
would just overide the former version. Now both versions will be checked
against.
With the addition of pgp key checking in Yay, the srcinfo parsing was
moved to before the pkgver() bump, leading to outdated pkgbuild
information.
Srcinfo parsing must be done after the pkgver() bump
The pkgver() bump must be done after downloading sources
makepkg's PGP checking is done as the sources download
yays PGP importing requires the srcingo to be parsed
Quite the chicken and egg problem
It is possible to skip the integ checks after the sources download
then parse the srcinfo
do the yay PGP check
then run the integ checks
the problem here is that to generate the srcinfo `makepkg --printsrcingo` is ran
This causes the pkgbuild to be sourced which I am not comftable with
doing without the integ checks.
Instead we parse the on disk .SRRCINFO that downloads with the PKGBUILD
just for the PGP checking. Later on we parse a fresh srcinfo straight
from `makepkg --printsrcingo`. This is a little bit less efficient but
more secure than the other option.
The callback is set to allways silently say yes, When passing to pacman
for the intall pacman will then ask the question giving the user
a chance to answer.
Similar to the --redownload flag, when specifed targets will be rebuilt
even if an up to date version is cached. --rebuildall can be used to
ensure uninstalled dependencies are rebuilt as well.
Additionally, unlike --redownload there is also --rebuildtree. This
causes a rebuild and reinstall of a package and all of it's dependencies
recursivley. This is designed for when a libary updae, breaks an
installed AUR package due to a partial upgrade. polybar is a common
example
--rebuild allows you to easily skip the cache and rebuild against a newer
libary version. --rebuildtree is a more nuclear option where you can
rebuild the whole dependency tree.
Using a WaitGroup forced the code to wait for every goroutine to finish.
Using channels allows us to exit early if any of a packages sources need
an update. No point in waiting for the other requests to finish if we
know there is an update.
The update process was already partly parallel: repo, aur and devel
updates where each given their own goroutine.
This gives two further layers of parallelization. Firstly the
`needsUpdate()` function is now run in parallel for each package checked.
One package may have many vcs sources so `needsUpdate()` also checks all
of its sources in parallel.
This gives an aproxamte 3x speedup for `yay -Su --devel` timing from
when the command starts to when the number menu apears.
unfortunately git://bitbucket.org/volumesoffun/polyvox.git never
resolves on my machine for some reason so it always hits the 5 second
timout period.
It then moves on to http:/bitbucket.org/volumesoffun/polyvox.git/ which
does resolve as expected. I have not looked into it but I fear this
applies to all gitbucket repos. Luckly they are few and far between.