diff options
Diffstat (limited to 'sh/upd')
-rwxr-xr-x | sh/upd | 18 |
1 files changed, 15 insertions, 3 deletions
@@ -141,10 +141,22 @@ misc () { } pac () { - pacpacs="$(sudo pacman --noconfirm -Syu | tee /dev/tty | grep -m1 '^Packages' | cut -d' ' -f3-)" + pac="$(sudo pacman --noconfirm -Syu | tee /dev/tty)" + pacpacs="$(echo "$pac" | grep -m1 '^Packages' | cut -d' ' -f3- | tee /dev/tty)" # Update rust toolchains before paru so paru can compile things in newest rust if needed. rustup update - aurpacs="$(paru --color never --noconfirm -aSu --ignore libredwg-git | tee /dev/tty | grep '^Aur' | cut -d' ' -f3-)" + aur="$(paru --color never --noconfirm -aSu --ignore libredwg-git)" + aurpacs="$(echo "$aur" | grep '^Aur' | cut -d' ' -f3-)" + # /usr/share/libalpm/hooks/rebuild-detector.hook has a line `NeedsTargets` shows it maybe checkrebuild by `printf 'zoom\nminiconda3' | checkrebuild` instead of check all, 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 + checkrebuild_pacs="$(echo "$pac$aur" | nawk ' + /^\([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 $aur start with ^:: + /^\([0-9]+\/[0-9]+\) |^:: / {f=0} + f { + if($2!~"zoom|miniconda3") + printf("%s ",$2) + }')" # part steal from aur comment # sometimes "ERROR: Failure while downloading": https://github.com/neovim/neovim/issues/15709 # echo 1, printf 1 and yes 1 all works? not sure why @@ -167,7 +179,7 @@ pac () { updated pacman packages: $pacpacs updated aur packages: $aurpacs pacdiff: $(pacdiff -o | tr '\n' ' ') -checkrebuild: $(checkrebuild | awk '$2!~"zoom|miniconda3"{printf("%s ",$2)}') +checkrebuild: $checkrebuild_pacs $(if echo "$pacpacs" | grep -q 'linux-\(megi-\)\?[0-9]'; then echo 'kernel upgraded, need reboot'; fi) " } |