The main reason behind this is for future localisation. yes and no can
be set to the localized equivalent and it should just work.
This Refactor also changes the function in ways which make it much less
confusing.
The param is no longer reversed and changed to a boolean. Before you had
to pass in Yy to get a default of no and vice versa.
The function now retuens false for no and true for yes. Before it would
return true if the default option was choosen.
Previously each call to an external command had two functions.
PassToFoo() and PassToFooCapture(). These functions are always similar
and end up with duplicated code.
So instead have the passToFoo() functions return the cmd itself and
create small helper functions show() and capture() which will run the
command and either forward it to std{out,err,in} or capture the output
Also the saveVCSInfo() function which was called after every makepkg
call is now only called after the pacman -U succeeds.
It seems the pkgbase is null for installed packages that are not part of
a split package. It was priviously assumed that if a package was not
part of a split package, pkgbase == pkgname would always be true.
Instead try to use pkgbase and if it does not exist fall back to
pkgname.
If a split package was installed and there was no package that matched
the name of the package base Yay would remove it even though there could
be other packages installed under that base but with a different name.
Now only clean a package if there are no installed packages under the
packagebase.
-Sc will delete cached AUR data from Yay's build dir according to
the `CleanMethod` specified in the Pacman config file.
-Scc will delete all cached AUR data.
Additionally -Sc will also delete all untracked files in the AUR cache.
This will delete things such as downloaded sources and built packages
but will leave directories behind.
This is very usefull because the only reason a directoiry should exist
in the cache is because of downloaded VCS sources. Non VCS sources are
redownloaded every update because when a new version is released a new
tarball has to be downloaded. But VCS sources are never redownloaded,
updates are simply pulled. For this reason the user probably wants to
keep this data as it is still usefull even after building and installing
a package.
Use the command `git ls-remote <url> <branch>` to track devel updates
rather than relying on the GitHub API.
This allows devel update to work for every git based source and
elimantes the rate limiting from GitHub.
The yay_vcs.json format has changed to better support packages which
multiple vcs sources and to track the protocols each source uses. And
track the branch that each source tracks in it's fragment.
Argument parsing now works mostly as expected for repo packages.
AUR packages are a little tricky becauce makepkg cant handle args such
as '--dbpath'.
Also out alpm handle does not read the commandline options so any
arguments relient on alpm will be ignored.
For now though it seems yay has gained back the functionality it once
had. While also having improved argument handling which should also be
expandable and make it easier to handle anything new that might have
been missed.
This reimplemens all operations yay previously supported:
'-S' 'Syu' 'Si' ect.
Currently the argument objects are not fully implemented with the code.
Theres alot of funky conversion from
argument object -> pkg, flags -> argument object
This is to just get back to the functionally we had before (almost).
I have not looked into it yet but alot of the time pacman flags get
passed to makepkg. this cases an error for most commands now because the
new system Passes all flags:
`yay -Syu` -> flags = '-S' '-y' '-u'
while the old system would have done:
`yay -Syu` -> op = '-Suy', flags = ''
So extra flags are no longer passed at all currently.
This means:
'yay -S aic94xx-firmware --noconfirm -b /tmp/pacutilesu2q6hw/tmp-pacman -d'
will no longer error and 'aic94xx-firmware' will be installed but the
database path change will not apply and the dep checking will not be
skipped.
passToPacman now takes and argParser as a paramater. And is implemented
for the simple cases in cmd.go. Although passToPacman is now left non
working in places which still try to usr the old call format and will
need to be reimplemented.