summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2022-10-30 15:54:58 +0000
committerV3n3RiX <venerix@koprulu.sector>2022-10-30 15:54:58 +0000
commit100226c624cdf8b3b1210c124b0b1ee6a3b3d816 (patch)
tree9e6a46b7dffef9a7b9eb7744c4e1b91430a637a0
parentde363a67dd99fa1395be5a5ce8d9a75472d81997 (diff)
various cleanups
-rw-r--r--src/backend/__init__.py3
-rw-r--r--src/backend/autoremove.py2
-rw-r--r--src/backend/installpkg.py8
-rw-r--r--src/backend/installsrc.py4
-rw-r--r--src/backend/killemerge.py2
-rw-r--r--src/backend/recoverdb.py2
-rw-r--r--src/backend/search.py (renamed from src/backend/searchpkg.py)8
-rw-r--r--src/backend/searchsrc.py6
-rw-r--r--src/backend/setbranch.py6
-rw-r--r--src/backend/setjobs.py2
-rw-r--r--src/backend/setprofile.py2
-rw-r--r--src/backend/syncspm.py2
-rw-r--r--src/backend/uninstall.py8
-rw-r--r--src/backend/update.py4
-rw-r--r--src/backend/upgradepkg.py8
-rw-r--r--src/backend/upgradesrc.py4
-rwxr-xr-xsrc/frontend/cli/sisyphus-cli.py26
-rw-r--r--src/frontend/gui/sisyphus-gui.py10
18 files changed, 52 insertions, 55 deletions
diff --git a/src/backend/__init__.py b/src/backend/__init__.py
index da8ac48..cd82005 100644
--- a/src/backend/__init__.py
+++ b/src/backend/__init__.py
@@ -8,8 +8,7 @@ from .killemerge import *
from .purgeenv import *
from .recoverdb import *
from .solvedeps import *
-from .searchpkg import *
-from .searchsrc import *
+from .search import *
from .setbranch import *
from .setjobs import *
from .setMirror import *
diff --git a/src/backend/autoremove.py b/src/backend/autoremove.py
index 3dc717d..28d4f31 100644
--- a/src/backend/autoremove.py
+++ b/src/backend/autoremove.py
@@ -19,7 +19,7 @@ def start():
def startx():
portageExec = subprocess.Popen(['emerge', '--depclean'], 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)
+ atexit.register(sisyphus.killemerge.start, portageExec)
for portageOutput in io.TextIOWrapper(portageExec.stdout, encoding="utf-8"):
print(portageOutput.rstrip())
diff --git a/src/backend/installpkg.py b/src/backend/installpkg.py
index 0661831..4dba1e5 100644
--- a/src/backend/installpkg.py
+++ b/src/backend/installpkg.py
@@ -15,9 +15,9 @@ import sisyphus.solvedeps
import sisyphus.syncdb
import sisyphus.update
-def cliExec(pkgname):
+def start(pkgname):
if sisyphus.checkenv.root():
- sisyphus.update.cliExec()
+ sisyphus.update.start()
binhostURL = sisyphus.getenv.binhostURL()
areBinaries,areSources,needsConfig = sisyphus.solvedeps.package(pkgname)
@@ -58,7 +58,7 @@ def cliExec(pkgname):
else:
sys.exit("\nYou need root permissions to do this, exiting!\n")
-def guiExec(pkgname):
+def startx(pkgname):
binhostURL = sisyphus.getenv.binhostURL()
areBinaries,areSources,needsConfig = sisyphus.solvedeps.package.__wrapped__(pkgname) #undecorate
@@ -80,7 +80,7 @@ def guiExec(pkgname):
portageExec = subprocess.Popen(['emerge', '--quiet', '--verbose', '--usepkg', '--usepkgonly', '--rebuilt-binaries', '--with-bdeps=y', '--misspell-suggestion=n', '--fuzzy-search=n'] + 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)
+ atexit.register(sisyphus.killemerge.start, portageExec)
for portageOutput in io.TextIOWrapper(portageExec.stdout, encoding="utf-8"):
print(portageOutput.rstrip())
diff --git a/src/backend/installsrc.py b/src/backend/installsrc.py
index 374a215..5eedda2 100644
--- a/src/backend/installsrc.py
+++ b/src/backend/installsrc.py
@@ -13,9 +13,9 @@ import sisyphus.solvedeps
import sisyphus.syncdb
import sisyphus.update
-def cliExec(pkgname):
+def start(pkgname):
if sisyphus.checkenv.root():
- sisyphus.update.cliExec()
+ sisyphus.update.start()
binhostURL = sisyphus.getenv.binhostURL()
areBinaries,areSources,needsConfig = sisyphus.solvedeps.package(pkgname)
diff --git a/src/backend/killemerge.py b/src/backend/killemerge.py
index c588252..f01af6b 100644
--- a/src/backend/killemerge.py
+++ b/src/backend/killemerge.py
@@ -1,4 +1,4 @@
#!/usr/bin/python3
-def cliExec(portageCmd):
+def start(portageCmd):
portageCmd.terminate()
diff --git a/src/backend/recoverdb.py b/src/backend/recoverdb.py
index 3c5cb78..c19cddc 100644
--- a/src/backend/recoverdb.py
+++ b/src/backend/recoverdb.py
@@ -6,7 +6,7 @@ import sisyphus.getfs
import sisyphus.syncdb
@animation.wait('recovering databases')
-def cliExec():
+def start():
if os.path.exists(sisyphus.getfs.remotePackagesCsv):
os.remove(sisyphus.getfs.remotePackagesCsv)
if os.path.exists(sisyphus.getfs.remoteDescriptionsCsv):
diff --git a/src/backend/searchpkg.py b/src/backend/search.py
index e0c33c6..d718c7e 100644
--- a/src/backend/searchpkg.py
+++ b/src/backend/search.py
@@ -1,6 +1,7 @@
#!/usr/bin/python3
import sqlite3
+import subprocess
import sisyphus.checkenv
import sisyphus.getfs
import sisyphus.update
@@ -124,10 +125,13 @@ def showSearch(filter, cat, pn, desc, single):
print(f"{cpn:45} {str(pkg['iv']):20} {str(pkg['av'])}")
print(f"\nFound {len(pkglist)} matching package(s) ...")
-def cliExec(filter, cat, pn, desc, single):
+def start(filter, cat, pn, desc, single):
if sisyphus.checkenv.root():
- sisyphus.update.cliExec()
+ sisyphus.update.start()
else:
print("\nYou are not root, cannot fetch updates.\nSearch result may be inaccurate!\n")
showSearch(filter, cat, pn, desc, single)
+
+def estart(pkgname):
+ subprocess.call(['emerge', '--search', '--getbinpkg'] + list(pkgname))
diff --git a/src/backend/searchsrc.py b/src/backend/searchsrc.py
deleted file mode 100644
index 5bd2279..0000000
--- a/src/backend/searchsrc.py
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/usr/bin/python3
-
-import subprocess
-
-def cliExec(pkgname):
- subprocess.call(['emerge', '--search', '--getbinpkg'] + list(pkgname))
diff --git a/src/backend/setbranch.py b/src/backend/setbranch.py
index a028d76..100d271 100644
--- a/src/backend/setbranch.py
+++ b/src/backend/setbranch.py
@@ -79,15 +79,15 @@ def giveWarning(branch,remote):
print("Hint : Use the even numbers (2,4,6,8) from 'sisyphus mirror list'")
print("Examples : 'sisyphus mirror set 4' or 'sisyphus mirror set 8'\n")
-def cliExec(branch,remote):
+def start(branch,remote):
if sisyphus.checkenv.root():
sisyphus.purgeenv.branch()
sisyphus.purgeenv.metadata()
injectGentooRepo(branch,remote)
injectRedcoreRepo(branch,remote)
injectPortageConfigRepo(branch,remote)
- sisyphus.setjobs.cliExec()
- sisyphus.setprofile.cliExec()
+ sisyphus.setjobs.start()
+ sisyphus.setprofile.start()
giveWarning(branch,remote)
else:
sys.exit("\nYou need root permissions to do this, exiting!\n")
diff --git a/src/backend/setjobs.py b/src/backend/setjobs.py
index 89ccc37..5a22b10 100644
--- a/src/backend/setjobs.py
+++ b/src/backend/setjobs.py
@@ -2,5 +2,5 @@
import subprocess
-def cliExec():
+def start():
subprocess.call(['/usr/share/sisyphus/helpers/set_jobs'])
diff --git a/src/backend/setprofile.py b/src/backend/setprofile.py
index 3a7f5e3..a5d6480 100644
--- a/src/backend/setprofile.py
+++ b/src/backend/setprofile.py
@@ -5,7 +5,7 @@ import platform
import subprocess
@animation.wait('setting up profile')
-def cliExec():
+def start():
if platform.uname()[4] == 'x86_64':
eselectExec = subprocess.Popen(['eselect', 'profile', 'set', 'default/linux/amd64/17.1/hardened'])
eselectExec.wait()
diff --git a/src/backend/syncspm.py b/src/backend/syncspm.py
index b97471e..9ea598d 100644
--- a/src/backend/syncspm.py
+++ b/src/backend/syncspm.py
@@ -4,5 +4,5 @@ import animation
import sisyphus.syncdb
@animation.wait('syncing spm changes')
-def cliExec():
+def start():
sisyphus.syncdb.localTable()
diff --git a/src/backend/uninstall.py b/src/backend/uninstall.py
index 617977f..d219b47 100644
--- a/src/backend/uninstall.py
+++ b/src/backend/uninstall.py
@@ -8,7 +8,7 @@ import sisyphus.checkenv
import sisyphus.killemerge
import sisyphus.syncdb
-def cliExec(pkgname):
+def start(pkgname):
if sisyphus.checkenv.root():
portageExec = subprocess.Popen(['emerge', '--quiet', '--depclean', '--ask'] + list(pkgname))
portageExec.wait()
@@ -16,7 +16,7 @@ def cliExec(pkgname):
else:
sys.exit("\nYou need root permissions to do this, exiting!\n")
-def cliExecForce(pkgname):
+def fstart(pkgname):
if sisyphus.checkenv.root():
portageExec = subprocess.Popen(['emerge', '--quiet', '--unmerge', '--ask'] + list(pkgname))
portageExec.wait()
@@ -24,10 +24,10 @@ def cliExecForce(pkgname):
else:
sys.exit("\nYou need root permissions to do this, exiting!\n")
-def guiExec(pkgname):
+def startx(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)
+ atexit.register(sisyphus.killemerge.start, portageExec)
for portageOutput in io.TextIOWrapper(portageExec.stdout, encoding="utf-8"):
print(portageOutput.rstrip())
diff --git a/src/backend/update.py b/src/backend/update.py
index 5a6a6cd..acbc445 100644
--- a/src/backend/update.py
+++ b/src/backend/update.py
@@ -17,7 +17,7 @@ def syncAll():
sisyphus.syncdb.remoteTable()
@animation.wait('fetching updates')
-def cliExec():
+def start():
activeBranch = sisyphus.checkenv.branch()
binhostURL = sisyphus.getenv.binhostURL()
isSane = sisyphus.checkenv.sanity()
@@ -31,7 +31,7 @@ def cliExec():
print("\nCurrent branch: '" + activeBranch + "' (testing)" + "\nCurrent binhost: '" + binhostURL + "' (stable)")
sys.exit("\nInvalid branch - binhost pairing; Use 'sisyphus branch --help' for help; Quitting.")
-def guiExec():
+def startx():
activeBranch = sisyphus.checkenv.branch()
binhostURL = sisyphus.getenv.binhostURL()
isSane = sisyphus.checkenv.sanity()
diff --git a/src/backend/upgradepkg.py b/src/backend/upgradepkg.py
index b4db8f5..0062bbf 100644
--- a/src/backend/upgradepkg.py
+++ b/src/backend/upgradepkg.py
@@ -15,9 +15,9 @@ import sisyphus.solvedeps
import sisyphus.syncdb
import sisyphus.update
-def cliExec():
+def start():
if sisyphus.checkenv.root():
- sisyphus.update.cliExec()
+ sisyphus.update.start()
binhostURL = sisyphus.getenv.binhostURL()
areBinaries,areSources,needsConfig = sisyphus.solvedeps.world()
@@ -58,7 +58,7 @@ def cliExec():
else:
sys.exit("\nYou need root permissions to do this, exiting!\n")
-def guiExec():
+def startx():
binhostURL = sisyphus.getenv.binhostURL()
areBinaries,areSources,needsConfig = sisyphus.solvedeps.world.__wrapped__() #undecorate
@@ -84,7 +84,7 @@ def guiExec():
portageExec = subprocess.Popen(['emerge', '--quiet', '--verbose', '--update', '--deep', '--newuse', '--usepkg', '--usepkgonly', '--rebuilt-binaries', '--backtrack=100', '--with-bdeps=y', '--misspell-suggestion=n', '--fuzzy-search=n', '@world'], 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)
+ atexit.register(sisyphus.killemerge.start, portageExec)
for portageOutput in io.TextIOWrapper(portageExec.stdout, encoding="utf-8"):
print(portageOutput.rstrip())
diff --git a/src/backend/upgradesrc.py b/src/backend/upgradesrc.py
index 0ad66c8..e12da8e 100644
--- a/src/backend/upgradesrc.py
+++ b/src/backend/upgradesrc.py
@@ -13,9 +13,9 @@ import sisyphus.solvedeps
import sisyphus.syncdb
import sisyphus.update
-def cliExec():
+def start():
if sisyphus.checkenv.root():
- sisyphus.update.cliExec()
+ sisyphus.update.start()
binhostURL = sisyphus.getenv.binhostURL()
areBinaries,areSources,needsConfig = sisyphus.solvedeps.world()
diff --git a/src/frontend/cli/sisyphus-cli.py b/src/frontend/cli/sisyphus-cli.py
index d81cc73..b8f500a 100755
--- a/src/frontend/cli/sisyphus-cli.py
+++ b/src/frontend/cli/sisyphus-cli.py
@@ -97,12 +97,12 @@ def search(package: List[str] = typer.Argument(...),
cat, pn = package[0].split('/')
else:
cat, pn = '', package[0]
- sisyphus.searchpkg.cliExec(filter.value, cat, pn, desc, quiet)
+ sisyphus.search.start(filter.value, cat, pn, desc, quiet)
else:
if not package:
raise typer.Exit('No search term provided, try: sisyphus search --help')
else:
- sisyphus.searchsrc.cliExec(package)
+ sisyphus.search.estart(package)
@app.command("install")
def install(pkgname: List[str], ebuild: bool = typer.Option(False, "--ebuild", "-e")):
@@ -124,9 +124,9 @@ def install(pkgname: List[str], ebuild: bool = typer.Option(False, "--ebuild", "
You can use the --ebuild option even if you don't want to install any ebuild(source) packages; It will fall back to binary packages only.
"""
if not ebuild:
- sisyphus.installpkg.cliExec(pkgname)
+ sisyphus.installpkg.start(pkgname)
else:
- sisyphus.installsrc.cliExec(pkgname)
+ sisyphus.installsrc.start(pkgname)
@app.command("uninstall")
def uninstall(pkgname: List[str], force: bool = typer.Option(False, "--force", "-f")):
@@ -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.uninstall.cliExec(pkgname)
+ sisyphus.uninstall.start(pkgname)
else:
- sisyphus.uninstall.cliExecForce(pkgname)
+ sisyphus.uninstall.fstart(pkgname)
@app.command("autoremove")
def autoremove():
@@ -178,7 +178,7 @@ def autoremove():
def update():
"""Update the Portage tree, the Redcore Overlay(s), Portage configs and Sisyphus's package database."""
if sisyphus.checkenv.root():
- sisyphus.update.cliExec()
+ sisyphus.update.start()
else:
sys.exit("\nYou need root permissions to do this, exiting!\n")
@@ -203,9 +203,9 @@ def upgrade(ebuild: bool = typer.Option(False, "--ebuild", "-e")):
You can use the --ebuild option even if you don't have any ebuild(source) packages installed; It will fall back to binary packages only.
"""
if not ebuild:
- sisyphus.upgradepkg.cliExec()
+ sisyphus.upgradepkg.start()
else:
- sisyphus.upgradesrc.cliExec()
+ sisyphus.upgradesrc.start()
@app.command("spmsync")
def spmsync():
@@ -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.start()
@app.command("rescue")
def rescue():
@@ -222,7 +222,7 @@ def rescue():
If Portage's package database is corrupted (in this case you're screwed anyway :D), only a partial resurrection will be possible.
If Portage's package database is intact, full resurrection will be possible.
"""
- sisyphus.recoverdb.cliExec()
+ sisyphus.recoverdb.start()
class Branch(str, Enum):
master = 'master'
@@ -267,7 +267,7 @@ def branch(branch: Branch = typer.Argument(...), remote: Remote = typer.Option(R
sisyphus mirror set 8
"""
- sisyphus.setbranch.cliExec(branch.value, remote.value)
+ sisyphus.setbranch.start(branch.value, remote.value)
@app.command("sysinfo")
def sysinfo():
@@ -286,5 +286,5 @@ def mirrorset(index: int):
if __name__ == "__main__":
if len(sys.argv) > 1 and not '--help' in sys.argv:
- sisyphus.setjobs.cliExec()
+ sisyphus.setjobs.start()
app()
diff --git a/src/frontend/gui/sisyphus-gui.py b/src/frontend/gui/sisyphus-gui.py
index 65d478c..67a8d97 100644
--- a/src/frontend/gui/sisyphus-gui.py
+++ b/src/frontend/gui/sisyphus-gui.py
@@ -390,28 +390,28 @@ class MainWorker(QtCore.QObject):
@QtCore.pyqtSlot()
def startUpdate(self):
self.started.emit()
- sisyphus.setjobs.cliExec()
- sisyphus.update.guiExec()
+ sisyphus.setjobs.start()
+ sisyphus.update.startx()
self.finished.emit()
@QtCore.pyqtSlot()
def startInstall(self):
self.started.emit()
pkgname = Sisyphus.pkgname
- sisyphus.installpkg.guiExec(pkgname)
+ sisyphus.installpkg.startx(pkgname)
self.finished.emit()
@QtCore.pyqtSlot()
def startUninstall(self):
self.started.emit()
pkgname = Sisyphus.pkgname
- sisyphus.uninstall.guiExec(pkgname)
+ sisyphus.uninstall.startx(pkgname)
self.finished.emit()
@QtCore.pyqtSlot()
def startUpgrade(self):
self.started.emit()
- sisyphus.upgradepkg.guiExec()
+ sisyphus.upgradepkg.startx()
self.finished.emit()
@QtCore.pyqtSlot()