Skip to content

fix: make syay operation-aware so non-build yay ops pass through (#1) - #27

Merged
manticore-projects merged 1 commit into
manticore-projects:mainfrom
musqz:fix/syay-operation-aware
Jun 23, 2026
Merged

manticore-projects merged 1 commit into
manticore-projects:mainfrom
musqz:fix/syay-operation-aware

Conversation

@musqz

@musqz musqz commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

syay unconditionally appended yay's edit-gate flags (--editor/--editmenu/ --answeredit) to every invocation, so non-build operations broke: yay --version, yay -Syu with nothing to build, -Ss search, -Q queries, etc. all received install-only flags and errored.

Add buildsPackages(argv) to classify the yay operation and inject the gate only when yay will actually fetch and build an AUR package (bare yay, yay <term>, -S <pkg>, -Syu/-Su). Everything else execs the real yay untouched, making alias yay=syay a safe drop-in again.

Covered by a 24-case table-driven test; go vet + full suite pass.

syay unconditionally appended yay's edit-gate flags (--editor/--editmenu/
--answeredit) to every invocation, so non-build operations broke:
`yay --version`, `yay -Syu` with nothing to build, `-Ss` search, `-Q`
queries, etc. all received install-only flags and errored.

Add buildsPackages(argv) to classify the yay operation and inject the
gate only when yay will actually fetch and build an AUR package (bare
`yay`, `yay <term>`, `-S <pkg>`, `-Syu`/`-Su`). Everything else execs
the real yay untouched, making `alias yay=syay` a safe drop-in again.

Covered by a 24-case table-driven test; go vet + full suite pass.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
@manticore-projects

Copy link
Copy Markdown
Owner

Thank you very much!
Although as far as I understand it: yay -Sy and -Syy (refresh databases, build nothing) still classify as gate=true, so they'd still get the edit flags appended. Likewise -Sp/--print and -Sh. Not a show-stopper though, and I have merged.

@manticore-projects
manticore-projects merged commit 44f7124 into manticore-projects:main Jun 23, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants