diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2021-01-30 14:41:20 +0000 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2021-01-30 14:41:20 +0000 |
commit | 515171c670ed6ae373002196b8cd3dd1154cd5cc (patch) | |
tree | 24c23352ea23f85f95cb065d200621949fd986c7 /src/backend/autoremove.py | |
parent | 1e64e01b293ecd775af05816cc3d299ebadb5960 (diff) |
ui : move package operations into the backend
Diffstat (limited to 'src/backend/autoremove.py')
-rw-r--r-- | src/backend/autoremove.py | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/backend/autoremove.py b/src/backend/autoremove.py index 497d8e5..5c2ee7a 100644 --- a/src/backend/autoremove.py +++ b/src/backend/autoremove.py @@ -1,9 +1,12 @@ #!/usr/bin/python3 +import atexit +import io import subprocess +import sys import sisyphus.check import sisyphus.database -import sys +import sisyphus.killportage def start(): if sisyphus.check.root(): @@ -12,3 +15,14 @@ def start(): sisyphus.database.syncLocal() else: sys.exit("\nYou need root permissions to do this, exiting!\n") + +def startqt(): + portageExec = subprocess.Popen(['emerge', '--depclean'], stdout=subprocess.PIPE) + # kill portage if the program dies or it's terminated by the user + atexit.register(sisyphus.killportage.start, portageExec) + + for portageOutput in io.TextIOWrapper(portageExec.stdout, encoding="utf-8"): + print(portageOutput.rstrip()) + + portageExec.wait() + sisyphus.database.syncLocal() |