1
0
mirror of https://github.com/Jguer/yay.git synced 2025-12-25 03:11:48 +01:00

360 Commits

Author SHA1 Message Date
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
LordBeerus
c466b96b94
fix: Correctly return exit status 1 when no packages are found (#2705)
* fix: Correctly return exit status 1 when no packages are found

* add testing for targets not found
2025-12-21 15:54:23 +01:00
Camilo Santana
dd0f44c78d
feat: add source of dependency error (#2720)
* feat: add source of dependency error

* add test for deps

* present the chain upwards

---------

Co-authored-by: Jo Garnier <git@jguer.space>
2025-12-21 14:38:15 +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
d52526284e
dep/topo: clarify graph API, rename methods, add tests (#2744)
* ci(yay): update packages on builder before building release

* update go-aur

* dep/topo: clarify graph API, rename methods, add tests

- Rename topo methods for clarity (TopoSortedLayers, AddProvides, HasProvides, GetProviderInfo)
- Add GoDoc describing edge direction and semantics
- Make ForEach safe when node info is missing
- Add unit tests for Dependencies/Dependents behavior
- Update call sites

* Revert "ci(yay): update packages on builder before building release"

This reverts commit bb64208c64c7c0223a4fda81ba22d98b3f97926d.
2025-12-21 14:27:55 +01:00
Jo
df80f397af
feat(repo): Sort repository results by pacman.conf repo order (#2740)
* ci(yay): update packages on builder before building release

* respect other repos in order

* ensure repo ends on top in case of tie

* revert dockerfile change
2025-12-19 21:13:47 +01:00
Jo
bcadb73755
Use custom http client in runtime, loosen timeouts (#2723)
* use custom http client in runtime, loosen timeouts

* Update pkg/runtime/runtime.go
---------
2025-12-06 13:38:06 +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
Jo
99770dec04
Fix pacman-git builds (#2712)
* fix pacman-git ABI change

* add guard for ABI stability

* bump alpm for ABI fix

* normalize strings for comparison
2025-11-28 21:20:27 +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
Joey Holtzman
38397d1609
Don't use OSC 8 links when output is not a terminal (#2689)
* Don't use OSC 8 links when output is not a terminal

* Use `UseColor` for disabling OSC 8 links

* Add tests for `CreateRepoLink`
2025-10-17 14:18:03 +02:00
Jo
81440e54a4
chore(go): modernize syntax (#2672)
* modernize go syntax

* fix lint
2025-09-18 18:05:58 +02:00
dependabot[bot]
122c221d02
chore(deps): bump the go-all group across 1 directory with 3 updates (#2669)
* chore(deps): bump the go-all group across 1 directory with 3 updates

Bumps the go-all group with 3 updates in the / directory: [github.com/stretchr/testify](https://github.com/stretchr/testify), [golang.org/x/sys](https://github.com/golang/sys) and [golang.org/x/term](https://github.com/golang/term).


Updates `github.com/stretchr/testify` from 1.10.0 to 1.11.1
- [Release notes](https://github.com/stretchr/testify/releases)
- [Commits](https://github.com/stretchr/testify/compare/v1.10.0...v1.11.1)

Updates `golang.org/x/sys` from 0.35.0 to 0.36.0
- [Commits](https://github.com/golang/sys/compare/v0.35.0...v0.36.0)

Updates `golang.org/x/term` from 0.34.0 to 0.35.0
- [Commits](https://github.com/golang/term/compare/v0.34.0...v0.35.0)

---
updated-dependencies:
- dependency-name: github.com/stretchr/testify
  dependency-version: 1.11.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go-all
- dependency-name: golang.org/x/sys
  dependency-version: 0.36.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go-all
- dependency-name: golang.org/x/term
  dependency-version: 0.35.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go-all
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix lint error

* update golangci

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jo Garnier <git@jguer.space>
2025-09-16 09:29:46 +02:00
Tamim Baschour
570b524f88
Turn search results into clickable links to their repo pages (#2653)
* Make package names clickable links to their repo pages using OSC 8 sequences (official arch repos and AUR only)

* fmt

* Map "devel" repo to AUR when creating package links

* Revert pkg/upgrade/upgrade.go This wasn't supposed to be here yet.
2025-08-13 15:16:26 +01: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
given
fd62f7f4c8
catch incompatible --clean flag when no operation is specified with better error message (#2644)
* improve error messaging when running yay -c

* use correct method in parsing -c flag

* better express prefixes in --help
2025-07-18 14:04:28 +02:00
Eisuke Kawashima
f1391b3e03
feat: add run0 for privilege elevator (#2637)
Co-authored-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
2025-07-08 15:08:55 +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
Jo
bf315041b1
refactor(upgrade): optimize code and improve maintainability (#2600)
* 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
2025-04-24 12:06:27 +02:00
Jo
d2c67ae0a4
fix(yay): fix minor performance and safety issue (#2581) 2025-02-25 17:15:34 +01:00
dmitrodem
3f2f6eae31
socks5 support (#2543)
* socks5 support

socks5 support via environment variable, e.g. SOCKS5_PROXY=localhost:1080 yay ...

* use default transport and update tests to work on arm
2024-12-20 16:49:05 +00:00
scarf
da53d3855f
fix: use positional argument for "providers available" translation (#2537) 2024-12-20 16:43:28 +00:00
Matthias Kurz
f23fe98a66
Fix comments: AUR_SEEN is the correct name (#2535)
Fix comments: AUR_SEEN is the correct name
2024-11-21 12:00:11 +01: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
Jo
89b32ee9ce
fix(parser): allow disable-sandbox option. fixes #2509 (#2511) 2024-09-24 08:12:41 +00:00
Absobel
bea53a4a09
fix: added missing spaces (#2386) 2024-09-19 14:15:44 +02:00
iTrooz
1b8f823f7c
Refactor part of UserExcludeUpgrades() (#2450) 2024-07-29 09:15:20 +02:00
Daniel Oh
836fc5922a
add short option for --repo (#2380)
* 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>
2024-06-28 16:40:35 +02:00
eveneast
61dd708a4a
chore: fix function name in comment (#2430)
Signed-off-by: eveneast <qcqs@foxmail.com>
2024-05-02 10:54:16 +00:00
James Raspass
6c2330528f
Use Go 1.21's min/max built-ins (#2405)
This simplifies the code compared to either rolling our own or awkwardly
using math's float functions with integers.
2024-03-23 23:27:30 +01:00
James Raspass
5d887cbd41
Replace github.com/pkg/errors with stdlib errors/fmt (#2400) 2024-03-16 09:10:49 +01:00
Jo
e8080f87c2
chore(yay): fix breaking -git ci test (#2373)
* chore(yay): fix breaking test

* chore(yay): fix breaking test

* chore(yay): fix breaking test

* update gomod

* remove debug commands
2024-02-19 17:04:06 +01:00
Jo
26aa171b2b
fix(query): remove -debug packages from missing list if base package is installed (#2372)
* chore(yay): fix pre-commit

* chore(yay): fix git ignore
2024-02-19 10:29:47 +00:00
Joey Holtzman
d02c45e5b6
Remove deprecated flags in favor of boolean flags (#2350) 2024-01-25 16:03:47 +01:00
Eng Zer Jun
d23e8925fa
fix(dep_graph): fix panic on selecting AUR providers (#2333)
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>
2023-12-11 17:45:54 +01:00
Kirill Motkov
0771ded99b
Refactor AURPKGBUILDRepos and Fix Localization Command in Makefile (#2313)
* optimize mutex usage and logging in AURPKGBUILDRepos function

* fix localization script

Fix localization script Makefile by adding missing semicolon and --no-translator flag
2023-11-20 16:58:20 +01:00
Joey Holtzman
d368f99be0
feat(yay): add boolean flags (#2285)
* 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
2023-09-27 12:36:57 +02:00
Jo
299aa1e123
fix(download): do not garble download output by default (#2283)
limit default concurrent downloads to 1
2023-09-18 09:51:32 +02:00
Joey Holtzman
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
e60ccdf8b7
Fix image recursive build (#2280)
* fix image recursive build

* add test fixes

* disable buildvcs

* fix integration
2023-09-15 11:17:18 +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
Jo
5995e55ddb
chore(topo): move topo to where it's used (#2250)
move topo into dep
2023-07-23 20:20:05 +00:00
Jo
04c82b8112
chore(yay): replace custom set package with dep (#2249)
* replace string set with dep

* remove unused field

* remove custom string set package
2023-07-23 17:29:01 +00:00
Joey Holtzman
dadc8c0d98
Re-add functionality for Installed and NotInstalled options in the menus (#2233)
* 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
2023-07-06 06:54:21 +00:00
smolx
6dd7933fbe
Fix handling targets with specified db (#2218)
* 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
2023-07-06 06:53:46 +00:00
Jo
5b8cc98afa
fix(dep_graph): do not package provides when providing itself. fix: #2215 (#2216)
fix #2215. package provides itself
2023-06-19 08:13:47 +00:00
smolx
c5a18e5000
Fix install reason preservation when package is reinstalled (#2195) 2023-06-11 16:16:05 +00:00
smolx
adde043514
Add --askyesremovemake option (#2199)
Same as --askremovemake option but with "Y" as a default answer.
2023-06-11 16:13:01 +00:00