From 2bbdb93594881248228ecdad553f20521edfe097 Mon Sep 17 00:00:00 2001 From: Marek Marczykowski Date: Mon, 12 Sep 2011 15:04:27 +0200 Subject: [PATCH] dom0/qvm-dom0-update: replace gpk-update-viewer with yum update (#347) --- dom0/qvm-tools/qvm-dom0-update | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/dom0/qvm-tools/qvm-dom0-update b/dom0/qvm-tools/qvm-dom0-update index fa5bfda0..36159d74 100755 --- a/dom0/qvm-tools/qvm-dom0-update +++ b/dom0/qvm-tools/qvm-dom0-update @@ -40,9 +40,17 @@ if [ $# -gt 0 ]; then yum install $@ elif [ -f /var/lib/qubes/updates/repodata/repomd.xml ]; then + # Above file exists only when at least one package was downloaded yum check-update if [ $? -eq 100 ]; then - gpk-update-viewer + + ID=$(id -ur) + if [ $ID != 0 ] ; then + echo "This script should be run as root, use sudo next time." + echo "Now you can manually run yum update (use sudo again)." + exit + fi + yum update fi else echo "No updates avaliable"