summaryrefslogtreecommitdiffstats
path: root/.config/yay/hooks/recently_modified.lua
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--.config/yay/hooks/recently_modified.lua18
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
3yay.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})