Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/pr/93'
Browse files Browse the repository at this point in the history
* origin/pr/93:
  qubes-dom0-update: print message when updates are available
  qubes-dom0-update: do not attempt to install updates with --check-only
  qubes-dom0-update: Pass --check-only option to the updatevm too
  • Loading branch information
marmarek committed Apr 13, 2022
2 parents 9213f76 + 9c449bb commit 90f2af0
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions dom0-updates/qubes-dom0-update
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ while [ $# -gt 0 ]; do
;;
--check-only)
CHECK_ONLY=1
UPDATEVM_OPTS+=( "$1" )
;;
--preserve-terminal)
exit_cmd=
Expand Down Expand Up @@ -136,6 +137,10 @@ case ${YUM_ACTION=upgrade} in
;;
esac

if [ "$CHECK_ONLY" == "1" ]; then
REMOTE_ONLY=1
fi

# Redirect operations on templates to qvm-template command
if find_regex_in_args '^qubes-template-' "${PKGS[@]}"; then
if [[ ${#PKGS[@]} -ne 1 ]]; then
Expand Down Expand Up @@ -270,6 +275,15 @@ qvm-run "${QVMRUN_OPTS[@]}" -- "$UPDATEVM" "$CMD" < /dev/null

RETCODE=$?
if [[ "$REMOTE_ONLY" = '1' ]] || [ "$RETCODE" -ne 0 ]; then
if [ "$CHECK_ONLY" = '1' ]; then
if [ "$RETCODE" -eq 100 ]; then
echo "There are dom0 updates available" >&2
elif [ "$RETCODE" -eq 0 ]; then
echo "No dom0 updates available" >&2
else
echo "Failed to check for dom0 updates" >&2
fi
fi
exit $RETCODE
fi
# Wait for download completed
Expand Down

0 comments on commit 90f2af0

Please sign in to comment.