From ad404bfbe63de831bf5712c89b4a7e1e488cd5a6 Mon Sep 17 00:00:00 2001 From: Christopher Laprise Date: Sun, 12 Mar 2017 23:15:45 -0400 Subject: [PATCH] Starting mods for template upgrade support --- dom0-updates/qubes-dom0-update | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/dom0-updates/qubes-dom0-update b/dom0-updates/qubes-dom0-update index 26d1de3..c00d133 100755 --- a/dom0-updates/qubes-dom0-update +++ b/dom0-updates/qubes-dom0-update @@ -61,11 +61,12 @@ while [ $# -gt 0 ]; do shift done -# Prevent template upgrade - this would override user changes - -# but do allow explicit template reinstalls -if [ "$YUM_ACTION" == "reinstall" ] && [[ "$PKGS" == *"qubes-template-"* ]]; then +# Prevent implicit update of template - this would override user changes - +# but do allow explicit template upgrade, downgrade, reinstall +if [ "$YUM_ACTION" == "reinstall" ] || [ "$YUM_ACTION" == "upgrade" ] || [ "$YUM_ACTION" == "downgrade" ] \ +&& [[ "$PKGS" == *"qubes-template-"* ]]; then TEMPLATE_EXCLUDE_OPTS="" - echo "WARNING: Reinstalling a template will erase all files in template's /home and /rw !" + echo "WARNING: Replacing a template will erase all files in template's /home and /rw !" ONEPKG=`cut -f 1 -d ' ' <<<$PKGS` if [[ "$ONEPKG" == "qubes-template-"* ]] && [[ "$ONEPKG" == "${PKGS#\ }" ]]; then # test "$PKGS" minus space @@ -83,7 +84,7 @@ if [ "$YUM_ACTION" == "reinstall" ] && [[ "$PKGS" == *"qubes-template-"* ]]; the TEMPLATE_NETVM="default" fi else - echo "ERROR: Specify only one package to reinstall template" + echo "ERROR: Specify only one package when replacing template" exit 1 fi