From 5fc5276d968a38d05fa5659c06392e83cc428516 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Sun, 30 Oct 2022 15:22:22 +0000 Subject: move uninstallAll -> uninstall --- src/backend/__init__.py | 6 +++--- src/backend/syncSPM.py | 8 -------- src/backend/syncspm.py | 8 ++++++++ src/backend/sysInfo.py | 7 ------- src/backend/sysinfo.py | 7 +++++++ src/backend/uninstall.py | 36 ++++++++++++++++++++++++++++++++++++ src/backend/uninstallAll.py | 36 ------------------------------------ src/frontend/cli/sisyphus-cli.py | 8 ++++---- src/frontend/gui/sisyphus-gui.py | 2 +- 9 files changed, 59 insertions(+), 59 deletions(-) delete mode 100644 src/backend/syncSPM.py create mode 100644 src/backend/syncspm.py delete mode 100644 src/backend/sysInfo.py create mode 100644 src/backend/sysinfo.py create mode 100644 src/backend/uninstall.py delete mode 100644 src/backend/uninstallAll.py (limited to 'src') diff --git a/src/backend/__init__.py b/src/backend/__init__.py index c3dc928..371de60 100644 --- a/src/backend/__init__.py +++ b/src/backend/__init__.py @@ -16,9 +16,9 @@ from .setMirror import * from .setprofile import * from .syncdb import * from .syncenv import * -from .syncSPM import * -from .sysInfo import * -from .uninstallAll import * +from .syncspm import * +from .sysinfo import * +from .uninstall import * from .updateAll import * from .upgradePkg import * from .upgradeSrc import * diff --git a/src/backend/syncSPM.py b/src/backend/syncSPM.py deleted file mode 100644 index b97471e..0000000 --- a/src/backend/syncSPM.py +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/python3 - -import animation -import sisyphus.syncdb - -@animation.wait('syncing spm changes') -def cliExec(): - sisyphus.syncdb.localTable() diff --git a/src/backend/syncspm.py b/src/backend/syncspm.py new file mode 100644 index 0000000..b97471e --- /dev/null +++ b/src/backend/syncspm.py @@ -0,0 +1,8 @@ +#!/usr/bin/python3 + +import animation +import sisyphus.syncdb + +@animation.wait('syncing spm changes') +def cliExec(): + sisyphus.syncdb.localTable() diff --git a/src/backend/sysInfo.py b/src/backend/sysInfo.py deleted file mode 100644 index 5ae29c2..0000000 --- a/src/backend/sysInfo.py +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/python3 - -import subprocess - -def show(): - subprocess.call(['emerge', '--info']) - diff --git a/src/backend/sysinfo.py b/src/backend/sysinfo.py new file mode 100644 index 0000000..5ae29c2 --- /dev/null +++ b/src/backend/sysinfo.py @@ -0,0 +1,7 @@ +#!/usr/bin/python3 + +import subprocess + +def show(): + subprocess.call(['emerge', '--info']) + diff --git a/src/backend/uninstall.py b/src/backend/uninstall.py new file mode 100644 index 0000000..617977f --- /dev/null +++ b/src/backend/uninstall.py @@ -0,0 +1,36 @@ +#!/usr/bin/python3 + +import atexit +import io +import subprocess +import sys +import sisyphus.checkenv +import sisyphus.killemerge +import sisyphus.syncdb + +def cliExec(pkgname): + if sisyphus.checkenv.root(): + portageExec = subprocess.Popen(['emerge', '--quiet', '--depclean', '--ask'] + list(pkgname)) + portageExec.wait() + sisyphus.syncdb.localTable() + else: + sys.exit("\nYou need root permissions to do this, exiting!\n") + +def cliExecForce(pkgname): + if sisyphus.checkenv.root(): + portageExec = subprocess.Popen(['emerge', '--quiet', '--unmerge', '--ask'] + list(pkgname)) + portageExec.wait() + sisyphus.syncdb.localTable() + else: + sys.exit("\nYou need root permissions to do this, exiting!\n") + +def guiExec(pkgname): + portageExec = subprocess.Popen(['emerge', '--depclean'] + pkgname, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + # kill portage if the program dies or it's terminated by the user + atexit.register(sisyphus.killemerge.cliExec, portageExec) + + for portageOutput in io.TextIOWrapper(portageExec.stdout, encoding="utf-8"): + print(portageOutput.rstrip()) + + portageExec.wait() + sisyphus.syncdb.localTable() diff --git a/src/backend/uninstallAll.py b/src/backend/uninstallAll.py deleted file mode 100644 index 617977f..0000000 --- a/src/backend/uninstallAll.py +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/python3 - -import atexit -import io -import subprocess -import sys -import sisyphus.checkenv -import sisyphus.killemerge -import sisyphus.syncdb - -def cliExec(pkgname): - if sisyphus.checkenv.root(): - portageExec = subprocess.Popen(['emerge', '--quiet', '--depclean', '--ask'] + list(pkgname)) - portageExec.wait() - sisyphus.syncdb.localTable() - else: - sys.exit("\nYou need root permissions to do this, exiting!\n") - -def cliExecForce(pkgname): - if sisyphus.checkenv.root(): - portageExec = subprocess.Popen(['emerge', '--quiet', '--unmerge', '--ask'] + list(pkgname)) - portageExec.wait() - sisyphus.syncdb.localTable() - else: - sys.exit("\nYou need root permissions to do this, exiting!\n") - -def guiExec(pkgname): - portageExec = subprocess.Popen(['emerge', '--depclean'] + pkgname, stdout=subprocess.PIPE, stderr=subprocess.PIPE) - # kill portage if the program dies or it's terminated by the user - atexit.register(sisyphus.killemerge.cliExec, portageExec) - - for portageOutput in io.TextIOWrapper(portageExec.stdout, encoding="utf-8"): - print(portageOutput.rstrip()) - - portageExec.wait() - sisyphus.syncdb.localTable() diff --git a/src/frontend/cli/sisyphus-cli.py b/src/frontend/cli/sisyphus-cli.py index 5e93669..c97dd3b 100755 --- a/src/frontend/cli/sisyphus-cli.py +++ b/src/frontend/cli/sisyphus-cli.py @@ -161,9 +161,9 @@ def uninstall(pkgname: List[str], force: bool = typer.Option(False, "--force", " will succeed, but the system will be broken """ if not force: - sisyphus.uninstallAll.cliExec(pkgname) + sisyphus.uninstall.cliExec(pkgname) else: - sisyphus.uninstallAll.cliExecForce(pkgname) + sisyphus.uninstall.cliExecForce(pkgname) @app.command("autoremove") def autoremove(): @@ -213,7 +213,7 @@ def spmsync(): When you install something with Portage directly (emerge), Sisyphus is not aware of that package, and it doesn't track it in it's database. Use this command to synchronize Sisyphus's package database with Portage's package database. """ - sisyphus.syncSPM.cliExec() + sisyphus.syncspm.cliExec() @app.command("rescue") def rescue(): @@ -272,7 +272,7 @@ def branch(branch: Branch = typer.Argument(...), remote: Remote = typer.Option(R @app.command("sysinfo") def sysinfo(): """Display information about installed core packages and portage configuration.""" - sisyphus.sysInfo.show() + sisyphus.sysinfo.show() @mirrorSetup.command("list") def mirrorlist(): diff --git a/src/frontend/gui/sisyphus-gui.py b/src/frontend/gui/sisyphus-gui.py index d5766dc..e33c3be 100644 --- a/src/frontend/gui/sisyphus-gui.py +++ b/src/frontend/gui/sisyphus-gui.py @@ -405,7 +405,7 @@ class MainWorker(QtCore.QObject): def startUninstall(self): self.started.emit() pkgname = Sisyphus.pkgname - sisyphus.uninstallAll.guiExec(pkgname) + sisyphus.uninstall.guiExec(pkgname) self.finished.emit() @QtCore.pyqtSlot() -- cgit v1.2.3