From a71ffe9cd09164182584bb01b3993881f7766dfd Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Tue, 18 Aug 2020 12:26:10 +0100 Subject: make sisyphus.check.root more portable, replace it everywhere --- src/backend/uninstall.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/backend/uninstall.py') diff --git a/src/backend/uninstall.py b/src/backend/uninstall.py index 748e085..2537b74 100644 --- a/src/backend/uninstall.py +++ b/src/backend/uninstall.py @@ -3,9 +3,12 @@ import subprocess import sisyphus.check import sisyphus.database +import sys def start(pkgname): - sisyphus.check.root() - portageExec = subprocess.Popen(['emerge', '--quiet', '--depclean', '--ask'] + list(pkgname)) - portageExec.wait() - sisyphus.database.syncLocal() + if sisyphus.check.root() == 0: + portageExec = subprocess.Popen(['emerge', '--quiet', '--depclean', '--ask'] + list(pkgname)) + portageExec.wait() + sisyphus.database.syncLocal() + else: + sys.exit("\nYou need root permissions to do this, exiting!\n") -- cgit v1.2.3