git.lirion.de

Of git, get, and gud

summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormail_redacted_for_web 2025-04-22 13:39:12 +0200
committermail_redacted_for_web 2025-04-22 13:39:12 +0200
commit2327574fa18e4678ab97e4cf650a152f5c615179 (patch)
tree74e5c33409142ce4013262f357a004db72ba76ac
parentf7862cb6b48469c69e5b088d5bbe30109eb6f6b0 (diff)
downloadnextcloud-update-2327574fa18e4678ab97e4cf650a152f5c615179.tar.bz2
Step 1: simple app update w/o quantification
-rwxr-xr-xbin/nextcloud-update33
1 files changed, 19 insertions, 14 deletions
diff --git a/bin/nextcloud-update b/bin/nextcloud-update
index c88d11c..ae15ef3 100755
--- a/bin/nextcloud-update
+++ b/bin/nextcloud-update
@@ -164,8 +164,16 @@ if [ "$NC_APPSUPD" -eq 1 ]; then
lnbegin "Parse: apps updates"
# TODO: look at update:check again and see what to grep(!) for (again, the script doesn't deliver
# return codes, nor does the crappy output at least have a json flag)
- lnwarn "not yet implemented"
- exit 255
+ # example output:
+ # Update for calendar to version 5.2.2 is available.
+ # Update for mail to version 5.0.2 is available.
+ # 2 updates available
+ if ! /usr/bin/printf '%b' "$UPDSTR" | grep -P '^[0-9]+ updates? available\.?$' > /dev/null; then
+ lnok 'none available'
+ else
+ lnok 'app updates available'
+ NC_UA_APPS=1
+ fi
fi
@@ -184,18 +192,15 @@ fi
# printf 'NC_UA_CORE: %b\n' "$NC_UA_CORE"
# printf 'NC_APPSUPD: %b\n' "$NC_APPSUPD"
# printf 'NC_UA_APPS: %b\n' "$NC_UA_APPS"
-if [[ "$NC_COREUPD" -eq 1 || "$NC_APPSUPD" -eq 1 ]]; then
- UPDCALL=( '/usr/local/bin/nextcloud-upgrade' )
- if [[ "$NC_COREUPD" -eq 1 && "$NC_UA_CORE" -eq 1 ]]; then
- UPDCALL+=( '-c' "$UPDVER" )
- elif [[ "$NC_COREUPD" -eq 1 && "$NC_UA_CORE" -eq 0 ]]; then
- UPDCALL+=( '-c' 0 )
- fi
- if [[ "$NC_APPSUP" -eq 1 && "$NX_UA_APPS" -eq 1 ]]; then
- UPDCALL+=( '-a' )
- fi
-else
- UPDCALL='/usr/bin/true'
+UPDCALL=( '/usr/local/bin/nextcloud-upgrade' )
+if [[ "$NC_COREUPD" -eq 1 && "$NC_UA_CORE" -eq 1 ]]; then
+ UPDCALL+=( '-c' "$UPDVER" )
+elif [[ "$NC_COREUPD" -eq 1 && "$NC_UA_CORE" -eq 0 ]]; then
+ UPDCALL+=( '-c' 0 )
+fi
+if [[ "$NC_APPSUPD" -eq 1 && "$NC_UA_APPS" -eq 1 ]]; then
+ echo BENIS
+ UPDCALL+=( '-a' )
fi
# /usr/local/bin/nextcloud-upgrade "$UPDVER" || exit "$?"
"${UPDCALL[@]}" || exit "$?"