From 72c68099d9de1ef505f854bdb66d024084c064c0 Mon Sep 17 00:00:00 2001
From: Xiao Pan <gky44px1999@gmail.com>
Date: Sun, 3 Mar 2024 22:20:51 -0800
Subject: fix: upd consider paru `==> Making package: ...`, also simplify the
 regex

---
 sh/upd | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

(limited to 'sh')

diff --git a/sh/upd b/sh/upd
index c180741..60102a4 100755
--- a/sh/upd
+++ b/sh/upd
@@ -149,10 +149,14 @@ pac () {
 	aurpacs="$(echo "$aurout" | grep '^Aur' | cut -d' ' -f3-)"
 	# /usr/share/libalpm/hooks/rebuild-detector.hook has a line `NeedsTargets` shows it maybe checkrebuild only upgraded packages by `printf 'zoom\nminiconda3' | checkrebuild` instead of maybe check all by `checkrebuild`, so I think query pacman hook will be faster than run another `checkrebuild`
 	# notes about awk f=1 things see https://git.flylightning.xyz/public_archive_codes/tree/sh/mrt
+	# about `/^(\(|:|=)/ {f=0}`:
+	# - consider $aurout start with `^:: Looking for devel upgrades...` , rebuild-detector.hook maybe the last hook to run for $pacout
+	# - consider ^(4/5), the hook is not the last
+	# - consider paru `==> Making package: ...`, the hook maybe followed by this
+	# - here is also a more complex one: `/^\([0-9]+\/[0-9]+\) |^:: |^==> [A-Z]/ {f=0}`
 	checkrebuild_pacs="$(echo "$pacout$aurout" | awk '
 	/^\([0-9]+\/[0-9]+\) Checking which packages need to be rebuilt$/ {f=1; next}
-	# check ^:: to consider rebuild-detector.hook is the last hook to run, and $aurout start with ^::
-	/^\([0-9]+\/[0-9]+\) |^:: / {f=0}
+	/^(\(|:|=)/ {f=0}
 	f {
 		if($2!~"zoom|miniconda3")
 			printf("%s ",$2)
-- 
cgit v1.2.3-70-g09d2