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.
* refactor(upgrade): reduce code duplication in Print methods and fix typo in Filter documentation
* refactor(upgrade): optimize UserExcludeUpgrades with early return and simplify GraphUpgrades function
* socks5 support
socks5 support via environment variable, e.g. SOCKS5_PROXY=localhost:1080 yay ...
* use default transport and update tests to work on arm
* 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>
* add short option for --repo
* run pre-commit
* update man page
* add fish completion
* add a N options
* add long options
---------
Co-authored-by: jguer <me@jguer.space>
This commit fixes https://github.com/Jguer/yay/issues/2289 by making
`provideMenu` returns the first option when it receives an error input
from the user (e.g. user sends EOF).
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
* optimize mutex usage and logging in AURPKGBUILDRepos function
* fix localization script
Fix localization script Makefile by adding missing semicolon and --no-translator flag
* feat(yay): add boolean flags
This feature now allows users to specify --<option>=<bool value> instead
of using --<option> and --no<option>. Specifying nothing results in the
boolean value being true. The flags prefixed with `no` are deprecated.
* chore(args): Print warning when using deprecated flags
* chore(yay): Update man page for deprecated options and add examples of
boolean flags being used
* 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
* fix(menus): Handle Installed and NotInstalled options correctly in the
menus
This functionality was temporarily removed. This commit adds that
functionality back.
* fix(tests): Mock InstalledRemotePackageNamesFn when necessary
* Fix handling targets with specified db
Handle it in a similar way to handling targets with unspecified db.
Also refactored GraphSyncPkg method to make stuff more DRY.
* update go-mod
* Fix excluding of packages with unsatisfied deps
When dependency is unsatisfied, add to the graph not only a dep node,
but relationship with parent too.
* Remove excess(duplicate) logic
* Add test cases of upgrading with unsatisfied deps
Before this fix dependencies for AUR targets were added to the graph
after each addition of a target node. Now dependencies are added only
after all target nodes are added to the graph.
Also added some tests for previously bugged cases.
If you answer yes to
:: Do you want to remove all other AUR packages from cache? [Y/n]
then we run cleanAUR(), intending to remove subdirectories of
~/.cache/yay that do not share a name with installed packages not
found in the sync repositories.
Where this was going wrong was cleanAUR() was getting an empty map from
dbExecutor.InstalledRemotePackages()---because InstalledRemotePackages
only recomputes its result if installedRemotePkgMap is nil, whereas
NewExecutor initialized it to an empty map. The symptom was it emptied
my ~/.cache/yay.
We do want a non-nil, empty installedRemotePkgMap to block recomputing
(that is, to indicate the user really has no remote packages), so now
NewExecutor initializes it to nil, and getPackageNamesBySource is
responsible for making sure it's non-nil before writing to it.
Fixes#2152, which seems to have been introduced in
4626a0409c4d34bcffe0d5ed499ebff893115c69.