Update qubes-dom0-update

(cherry picked from commit d316624f61)
This commit is contained in:
ttasket 2016-06-18 05:24:18 -04:00 committed by Marek Marczykowski-Górecki
parent 9fb5f430fb
commit cf6b475bcd
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -71,6 +71,8 @@ if [ "$YUM_ACTION" == "reinstall" ] && [[ "$PKGS" == *"qubes-template-"* ]]; the
if [[ "$ONEPKG" == "qubes-template-"* ]] && [[ "$ONEPKG" == "${PKGS#\ }" ]]; then # test "$PKGS" minus space
# Prepare to backup template root.img in case reinstall doesn't complete.
TEMPLATE=${ONEPKG#qubes-template-}
TEMPLATE_NETVM=`qvm-prefs $TEMPLATE netvm` || exit 1
if [[ "$TEMPLATE_NETVM" == *"(default)" ]] ; then TEMPLATE_NETVM="default"
BAK_TEMPLATE_ROOT=`qvm-prefs $TEMPLATE root_img` || exit 1
else
echo "ERROR: Specify only one package to reinstall template"
@ -199,10 +201,13 @@ elif [ -f /var/lib/qubes/updates/repodata/repomd.xml ]; then
yum $YUM_OPTS $YUM_ACTION ; RETCODE=$?
if [ $RETCODE -eq 0 ] && [[ -n "$BAK_TEMPLATE_ROOT" ]] ; then
# Reinstall went OK, remove backup file.
echo "Removing $BAK_TEMPLATE_ROOT-bak"
rm -f "$BAK_TEMPLATE_ROOT-bak"
if [[ -n "$BAK_TEMPLATE_ROOT" ]] ; then
qvm-prefs -s $TEMPLATE netvm $TEMPLATE_NETVM
if [ $RETCODE -eq 0 ] ; then
# Reinstall went OK, remove backup file.
echo "Removing $BAK_TEMPLATE_ROOT-bak"
rm -f "$BAK_TEMPLATE_ROOT-bak"
fi
fi
fi
fi