dom0-updates: output diagnostics messages to stderr

Do not interfere with yum/dnf output, which can be parserd by salt in
dom0. This is especially the case for listing available updates.
This commit is contained in:
Marek Marczykowski-Górecki 2020-03-16 02:10:14 +01:00
parent b8a39a7fe2
commit b02dd6a768
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -139,7 +139,7 @@ if ! $YUM --help | grep -q downloadonly; then
mapfile -t PKGLIST < <(echo "$UPDATES_FULL" | grep -v "^Obsoleting\|Could not" | cut -f 1 -d ' ') mapfile -t PKGLIST < <(echo "$UPDATES_FULL" | grep -v "^Obsoleting\|Could not" | cut -f 1 -d ' ')
if [ "$check_update_retcode" -eq 0 ]; then if [ "$check_update_retcode" -eq 0 ]; then
# exit code 0 means no updates available - regardless of stdout messages # exit code 0 means no updates available - regardless of stdout messages
echo "No new updates available" echo "No new updates available" >&2
exit 0 exit 0
fi fi
YUM_COMMAND="yumdownloader --destdir=$DOM0_UPDATES_DIR/packages --resolve" YUM_COMMAND="yumdownloader --destdir=$DOM0_UPDATES_DIR/packages --resolve"
@ -194,7 +194,7 @@ if ls "$DOM0_UPDATES_DIR"/packages/*.rpm > /dev/null 2>&1; then
rpmkeys_error=1 rpmkeys_error=1
rm "$pkg" rm "$pkg"
else else
echo "Successfully verified $pkg" echo "Successfully verified $pkg" >&2
fi fi
done done
if [ ! "$rpmkeys_error" = "0" ]; then if [ ! "$rpmkeys_error" = "0" ]; then
@ -211,5 +211,5 @@ if ls "$DOM0_UPDATES_DIR"/packages/*.rpm > /dev/null 2>&1; then
exit "$qrexec_exit_code" exit "$qrexec_exit_code"
fi fi
else else
echo "No packages downloaded" echo "No packages downloaded" >&2
fi fi