summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXiao Pan <gky44px1999@gmail.com>2024-04-27 18:01:55 -0700
committerXiao Pan <gky44px1999@gmail.com>2024-04-27 18:01:55 -0700
commit61e1aae0aa39061169ca265ca171ec66b48a5fcc (patch)
tree5cbd8dc157ce58ea495d1ba9df127a3e55c04ffa
parenta5ac2d8acdebb8847f3510ca7cee20287e5cf9fa (diff)
fix: upd query checkrebuild hook log remove repeated pkg name
-rwxr-xr-xsh/upd5
1 files changed, 4 insertions, 1 deletions
diff --git a/sh/upd b/sh/upd
index 9ffa1b0..0ac12fd 100755
--- a/sh/upd
+++ b/sh/upd
@@ -164,12 +164,15 @@ pac () {
# - 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. Note: paru somehow still gives color output even if I use --color never, so I can't check with ^=, so I choose to check with ==>
+ # awk use `if(!a[$2]++)` to check if package name is repeated in multiple checkrebuild pacman hook run, happened when upgrade python cause all python packages need to be rebuilt
+ # TODO: Some packages maybe are rebuilt later on when paru upgrade packages, but those will still got shown in upd log. Try consider this situation. e.g., when pacman upgrade packages, checkrebuild hook output a b c d packages, then paru upgrade d, now checkrebuild hook output a b c, the final upd log will have a b c d all packages instead of a b c
checkrebuild_pacs="$(echo "$pacout$aurout" | awk '
/^\([0-9]+\/[0-9]+\) Checking which packages need to be rebuilt$/ {f=1; next}
/^(\(|:)|==>/ {f=0}
f {
if($2!~"zoom|miniconda3")
- printf("%s ",$2)
+ if(!a[$2]++)
+ printf("%s ",$2)
}')"
# part steal from aur comment
# sometimes "ERROR: Failure while downloading": https://github.com/neovim/neovim/issues/15709