24 Commits
Author SHA1 Message Date
f43305951a [repo-assist] refactor(srcinfo): deduplicate VCS updates (#2917)
* refactor(srcinfo): deduplicate VCS updates

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix broken test

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Jo Garnier <me@jguer.space>
2026-07-31 02:57:02 +09:00
github-actions[bot] f76bbba9be refactor(workdir): remove unnecessary global NoConfirm mutation in removeMake (#2906)
refactor(workdir): remove unnecessary global NoConfirm mutation in removeMake

removeMake always removes packages non-interactively, so it sets
settings.NoConfirm = true, calls BuildPacmanCmd, then restores the
original value. This pattern is thread-unsafe and redundant because
BuildPacmanCmd already accepts a noConfirm bool parameter.

Pass true directly to BuildPacmanCmd, eliminating the global mutation.
2026-07-19 01:58:04 +02:00
Jo 8fcaff9e6f fix(depgraph): reduce memory allocations (#2875)
* cleanup mem allocs

* lint
2026-06-18 19:58:23 +02:00
Jo 70d7a0f0a8 fix(lua): Reduce event size of PostInstall and SearchFilter hooks (#2871)
* remove fields from events that might not be needed yet

* reduce event size
2026-06-17 21:40:02 +02:00
Jo 15057c8dab misc(ci): add modernize linter and update versioning (#2870)
* add modernize linter

* lint unused

* update imports

* ignore agent info
2026-06-17 21:09:53 +02:00
Jo 3b3a2b1dcc fix: search filter hooking and multierror cleanup (#2868)
* fix search filtering pass along

* prepare inclusion 'modernize' linter and use errors.join instead
2026-06-17 19:34:33 +02:00
Jo 4dbf124c51 feat(lua): add search filter and post install hooks (#2867)
* search filter and post install

add examples

* add tag
2026-06-16 23:35:18 +02:00
Jo 16479dcaf3 feat: Add AURPostDownload hook (#2856)
* run hooks after source download

* lint

* nitpick: remove event table indirection
2026-06-15 18:10:41 +02:00
Jo 1501438fba AUR: Add AURPreInstall hooks (#2854)
* add lua hooks on aur package installs

* add abort command to differentiate errors and aborts

* u
2026-06-15 13:31:13 +02:00
Jo e6a7c89130 fix: completion cache goroutine races with ALPM handle cleanup (#2835)
* fix: completion cache goroutine races with ALPM handle cleanup

* update go mod

* fix: failed ci builder
2026-06-05 10:23:33 +02:00
Jo 3b79933638 test: harden coverage and make tests parallel-safe (#2797)
* Test coverage hardening and parallel-safe refactors

Add focused test coverage for under-tested operational paths, edge branches,
and make key table-driven suites parallel-safe. Also fixed flaky installer
test execution under repeated/parallel runs.

* chore: fix goimports ordering for golangci-lint

* Test(download): expand integration coverage for download paths

Add integration scenarios for force/pull repo updates, repo-only and skip semantics,
and direct AUR download/scanner coverage used by getpkgbuild and package preparation.

* Test(exe): relax systemd-run path assertion

Fix flaky TestBuildGitCmd by accepting an absolute systemd-run path while still
asserting the expected binary is used.

* Test(text): avoid race in color tests

Remove parallel execution from TestColorHash so global UseColor writes do not
overlap with color consumers in parallel tests and trigger race detector
failures.

* fix potential race conditions
2026-03-25 00:51:34 +01:00
Michele PalazziandJo Garnier 398005c7cd fix: Ensure --asexplicit applies to explicitly targeted packages (#2766)
* fix: Ensure --asexplicit applies to explicitly targeted packages and add a regression test.

Signed-off-by: Michele Palazzi <sysdadmin@m1k.cloud>

* lint

---------

Signed-off-by: Michele Palazzi <sysdadmin@m1k.cloud>
Co-authored-by: Jo Garnier <git@jguer.space>
2026-01-22 09:42:36 +01:00
Jo 15c0597562 Build: Build without install with -B . (#2684)
* remove deprecated --tar flag and add --gitflags

Built without installing with -B

fix git tests gitBin

align with next

* fix order of ops
2025-12-22 15:22:10 +01:00
Joey Holtzman 5cdb61fa05 Fix building packages with incompatible architectures in makepkg 7.1.0+ (#2741) 2025-12-21 14:35:18 +01:00
Jo aecd78040c chore(completion): refactor and increase coverage (#2722)
* 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
2025-12-06 13:20:13 +01:00
Edwin Peer 3629c0a1ff Don't rely on transparent decompression in sync list (#2710)
* 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>
2025-11-28 18:00:03 +01:00
Jo 81440e54a4 chore(go): modernize syntax (#2672)
* modernize go syntax

* fix lint
2025-09-18 18:05:58 +02:00
Jo ea3fceb7b4 fix(srcinfo): avoid panic on srcinfo failed parse (#2645)
avoid panic on srcinfo failed parse. fixes #2640
2025-07-19 10:46:16 +02:00
Jo b745f87210 chore(ci): update golangci lint v2.1.5 (#2615)
* chore(ci): update golangci-lint to v2.1.5 in ci.Dockerfile

* add golangci

* fix lint

* fix lint pkg/upgrade

* reenable lint
2025-05-01 10:00:10 +02:00
Jo 2dcf94544c refactor(build): optimize allocations and add tests (#2601)
* perf(build): optimize map/slice allocations and use strings.Builder

* test(build): add tests for parsePackageList
2025-04-29 22:45:24 +02:00
Ferdinand Bachmann 95fc0938fd fix(installer): Fix the same pkgbase being built multiple times on error (#2561)
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.
2025-04-29 22:45:10 +02:00
Ferdinand Bachmann ec837c831d fix(installer): Fixes the same pkgbase being built multiple times (#2534)
* 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>
2024-11-19 11:08:28 +01:00
Joey Holtzmanandjguer 04c76a404e feat(install): add --keepsrc to keep pkg/ and src/ directories (#2272)
* 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>
2023-09-18 09:21:42 +02:00
Jo 8916cd174b refactor(yay): move cfg inside of runtime (#2259)
* 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
2023-08-06 21:39:41 +02:00