summaryrefslogtreecommitdiff
path: root/sh
diff options
context:
space:
mode:
authorXiao Pan <xyz@flylightning.xyz>2025-09-14 17:47:17 +0800
committerXiao Pan <xyz@flylightning.xyz>2025-09-14 17:47:17 +0800
commit7fc02d740319b4fdb4fdaeec69d8fc7b87c87da6 (patch)
tree1fab87d063529faf5032336a2a68639b23a5c98e /sh
parentf4224b2b4d00501b8a0636286e96f58cc71a221e (diff)
upd auto update PKGBUILDs; less empty line in logHEADmaster
Diffstat (limited to 'sh')
-rwxr-xr-xsh/upd18
1 files changed, 15 insertions, 3 deletions
diff --git a/sh/upd b/sh/upd
index 64d9435..195acec 100755
--- a/sh/upd
+++ b/sh/upd
@@ -193,6 +193,8 @@ userjs () {
}
misc () {
+ nv=
+
"$EDITOR" +PlugClean! +PlugUpdate +qa
if [ "$hostname" = xyzinsp ] || [ "$hostname" = xyzpp ]; then
@@ -200,6 +202,14 @@ misc () {
fi
if [ "$hostname" = xyzinsp ]; then
+ # nvchecker pkgctl updated pkgbuilds. Need test, commit, push, and aurpublish.
+ # Test shows pkgctl version upgrade need 2>&1, else awk not work, not
+ # sure why, maybe related to pkgctl's pretty outputs.
+ # Test shows awk need $3 instead of $2, not sure why.
+ nv="$(pkgctl version upgrade "$HOME/programs/repos/aur/stardict-wikt-en-all" \
+ "$HOME/programs/repos/aur/stardict-wikt-en-en" 2>&1 \
+ | tee /dev/tty \
+ | awk -F'[: ]' '/upgraded/{printf(" %s",$3)}')"
sudo hardcode-fixer
ssh pp '[ -s "$HOME/.local/share/sdcv_history" ] && cat "$HOME/.local/share/sdcv_history" && rm "$HOME/.local/share/sdcv_history"' >> "$XDG_DATA_HOME/sdcv_history"
awk '!a[$0]++' "$XDG_DATA_HOME/sdcv_history" | sponge "$XDG_DATA_HOME/sdcv_history"
@@ -225,6 +235,9 @@ misc () {
git -C "$HOME/programs/roff/myresume" pull
pass git pull
fi
+
+ log="${log}nvchecker:$nv
+"
}
pac () {
@@ -271,8 +284,7 @@ pac () {
# pacdiff default use pacman database, so no need `sudo -E` for find, but will be a little bit slower
# [^-] consider util-linux; \(^\|[^-]\) consider linux is the first package, ex: pacout is only 'linux-6.6.6'
- log="$log
-updated pacman packages: $pacpacs
+ log="${log}updated pacman packages: $pacpacs
updated aur packages: $aurpacs
pacdiff: $(pacdiff -o | tr '\n' ' ')
checkrebuild: $checkrebuild_pacs
@@ -380,7 +392,7 @@ else
esac
done
fi
-[ "$log" ] && printf '%s' "$log" | tee "$XDG_DOCUMENTS_DIR/logs/upd.log"
+[ "$log" ] && printf '\n%s' "$log" | tee "$XDG_DOCUMENTS_DIR/logs/upd.log"
[ "$hostname" = xyzpp ] && gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-ac-type suspend
# `[ "$hostname" = xyzpp ] && ...` if check failed will have exit status of 1, unlike check with `if`
# I decided to always `exit 0` if reached end, so commands like `upd -p && ...` can keep running