Skip to content

Commit

Permalink
falter-berlin-autoupdate: if possible, use --ignore-minor-compat-version
Browse files Browse the repository at this point in the history
The option `--ignore-minor-compat-version` enables the sysupgrade command
to do an update also in case, there is a minor compat-version upgrade. This
is relevant for the change from swconfig to dsa.

Signed-off-by: Martin Hübner <martin.hubner@web.de>
  • Loading branch information
Akira25 committed Sep 23, 2024
1 parent 49fd706 commit f3f50d7
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/falter-berlin-autoupdate/files/autoupdate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,13 @@ if semverLT "$FREIFUNK_RELEASE" "$latest_release"; then
if [ -n "$OPT_N" ]; then
sysupgrade -n "$PATH_BIN"
else
sysupgrade "$PATH_BIN"
check_ignore_minor_compat
ret_code=$?
if [ $ret_code = 0 ]; then
sysupgrade --ignore-minor-compat-version "$PATH_BIN"
else
sysupgrade "$PATH_BIN"
fi
fi
log "done."
fi
Expand Down
11 changes: 11 additions & 0 deletions packages/falter-berlin-autoupdate/files/lib_autoupdate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -246,3 +246,14 @@ min_valid_certificates() {

return $cert_cnt
}

check_ignore_minor_compat() {
# checks if the installed sysupgrade tool supports the option
# --ignore-minor-compat-version already.
# returns 0 if option is available, 1 otherwise
if sysupgrade -h | grep -q 'ignore-minor-compat-version'; then
return 0
else
return 1
fi
}

0 comments on commit f3f50d7

Please sign in to comment.