* refactor(completion): separate cache validation from update logic
- Add NeedsUpdate() to check if completion cache is stale
- Rename Update() to UpdateCache() and make it unconditional
- Move caching decision to call sites (Show and sync.Run)
- Improve error handling with proper defer for file close
* increase completion coverage
* launch goroutine if update is needed
* remove user dependent test
* Don't rely on transparent decompression in sync list
The current sync list code relies on the HTTP client library transparently
decompressing the packages.gz file. This only works if the server provides
the 'Content-Encoding: gzip" HTTP header, which has apparently changed
recently.
This patch explicitly decompresses the package list if no encoding
information is provided by the server.
Fixes: https://github.com/Jguer/yay/issues/2709
v2: added gzip closer and added error handling
v3: blindly attempt to decompress, since the content encoding is
stripped by the HTTP client when transparently decompressing.
v4: also fix the fetch in command completion using common interface
Signed-off-by: Edwin Peer <espeer@gmail.com>
* fix failing tests, add fallback logging, add gz testcase
* fix lint
---------
Signed-off-by: Edwin Peer <espeer@gmail.com>
fix(installer): Fixes the same pkgbase being built multiple times on error
The previous fix commit ec837c8 failed to address the case where the
build fails, as packages are only added to builtPkgDests on a successful
build. This commit addresses this by adding the package to the map earlier.
Fixes#2560.
* fix(installer): Fixes the same pkgbase being built multiple times
When building a PKGBUILD pkgbase with multiple pkgnames,
installAURPackages() invokes buildPkg() multiple times for the same
pkgbase. This causes prepare() to be run multiple times for the same
pkgbase, since detection of already built packages happens after
prepare().
Additionally, detection of already built packages can fail if the split
debug packages are enabled and the package does not contain any
binaries, causing no -debug package to be created by makepkg even though
it is listed by makepkg --packagelist.
This commit fixes this by keeping track of the pkgdests built by
buildPkg() and avoiding rebuilds of the same pkgbase in the same yay
invocation.
Fixes#2340.
Signed-off-by: Ferdinand Bachmann <ferdinand.bachmann@yrlf.at>
* fix(installer): Fixes buildPkg() isTarget param being order-dependent
Previously, the buildPkg invocation for a pkgbase only considered
whether the current pkgname is part of installer.origTargets. This made
the decision whether to rebuild the package order-dependent.
This commit fixes this by keeping track of which pkgbases are part of
installer.origTargets and rebuilding the pkgbase if any of its pkgnames
is part of origTargets.
* fix(tests): Test that installing split packages avoids rebuilds
The previous two commits changed how split packages (packages with the same
pkgbase) are built, ensuring that those packages aren't built multiple
times.
This commit updates the lists of commands that the tests expect to be
run so that `makepkg` isn't run multiple times per pkgbase.
---------
Signed-off-by: Ferdinand Bachmann <ferdinand.bachmann@yrlf.at>
* feat(install): add --nocleanbuild to keep pkg/ and src/ directories for
AUR packages
Providing this flag during installation of AUR packages allows for keeping
the src/ and pkg/ directories produced my makepkg. If the user wants to
delete the directories, they can either select to cleanBuild in the
cleanmenu or run the installation without the --nocleanbuild flag (yay
will only remove the directories if the package is rebuilt)
* fix(completion): simplify description for --nocleanbuild in fish
This makes the description consistent with the descriptions in the
man page, --help, and zsh completion.
* refactor(install): Rename --nocleanbuild to --keepsrc
This naming scheme is more familiar to users since it is the name of the
flag in Paru.
---------
Co-authored-by: jguer <me@jguer.space>
* rework relationship between runtime and cfg
* separate runtime from cfg
* simplify instantiation logic
* move installer to appropriate package
* move operator to sync package
* add tests for srcinfo service
* consolidate srcinfo service in sync
* add logger to srcinfo
* add logger to preparer
* remove unused text functions
* remove remaining text.* from srcinfo
* remove global logger parts
* remove global org method exports
* remove global logger
* move text->input
* add rule to prevent fmt.Print
* update golangci go version
* remove outdated FAQs
* remove outdated FAQs