diff options
| author | Pavel Egorov <[email protected]> | 2026-07-29 03:30:49 +0300 |
|---|---|---|
| committer | Pavel Egorov <[email protected]> | 2026-07-29 03:30:49 +0300 |
| commit | 71034d171fe80d305d766e15ba894de78062cc11 (patch) | |
| tree | 1b0209f66d466d506065250b76f139706e0c63d1 /.config/yay/hooks/recently_modified.lua | |
| parent | 6252009efa60f83094318a91be2d627709b1af8d (diff) | |
| download | dotfiles-main.tar.gz dotfiles-main.zip | |
Diffstat (limited to '')
| -rw-r--r-- | .config/yay/hooks/recently_modified.lua | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/.config/yay/hooks/recently_modified.lua b/.config/yay/hooks/recently_modified.lua new file mode 100644 index 0000000..561d87e --- /dev/null +++ b/.config/yay/hooks/recently_modified.lua | |||
| @@ -0,0 +1,18 @@ | |||
| 1 | -- Copypasted from https://github.com/Jguer/yay/blob/next/doc/examples/recently_modified.lua | ||
| 2 | |||
| 3 | yay.create_autocmd("UpgradeSelect", { | ||
| 4 | desc = "skip recently modified AUR upgrades", | ||
| 5 | callback = function(event) | ||
| 6 | yay.log.info("pre-excluding AUR packages modified in the last 3 days") | ||
| 7 | local exclude = {} | ||
| 8 | local recent_cutoff = os.time() - (3 * 24 * 60 * 60) | ||
| 9 | for _, pkg in ipairs(event.data.upgrades) do | ||
| 10 | if pkg.repository == "aur" and pkg.last_modified >= recent_cutoff then | ||
| 11 | yay.log.warn("pre-excluding recently modified AUR package: ", pkg.name) | ||
| 12 | table.insert(exclude, pkg.name) | ||
| 13 | end | ||
| 14 | end | ||
| 15 | |||
| 16 | return { exclude = exclude, skip_menu = false } | ||
| 17 | end, | ||
| 18 | }) | ||
