summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2022-10-26 13:27:42 +0100
committerV3n3RiX <venerix@koprulu.sector>2022-10-26 13:27:42 +0100
commitf2b26188fd4debefb9a93932a919d39bf80be10a (patch)
tree3b54df26b65c718af9a8f0ef82ee5c3fcf9484e4
parentb51a4c690ccf0353e87211ea4864d49b1c3d5c70 (diff)
rename start && startqt -> cliExec && guiExec
-rw-r--r--src/backend/autoRemoveAll.py6
-rw-r--r--src/backend/installPkg.py8
-rw-r--r--src/backend/installSrc.py4
-rw-r--r--src/backend/killPortage.py2
-rw-r--r--src/backend/recoverDatabase.py2
-rw-r--r--src/backend/searchPkg.py4
-rw-r--r--src/backend/searchSrc.py2
-rw-r--r--src/backend/setBranch.py7
-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/uninstallAll.py2
-rw-r--r--src/backend/updateAll.py4
-rw-r--r--src/backend/upgradePkg.py8
-rw-r--r--src/backend/upgradeSrc.py4
-rwxr-xr-xsrc/frontend/cli/sisyphus-cli.py24
-rw-r--r--src/frontend/gui/sisyphus-gui.py10
17 files changed, 46 insertions, 47 deletions
diff --git a/src/backend/autoRemoveAll.py b/src/backend/autoRemoveAll.py
index 982c7b3..85a7b7f 100644
--- a/src/backend/autoRemoveAll.py
+++ b/src/backend/autoRemoveAll.py
@@ -8,7 +8,7 @@ import sisyphus.checkEnvironment
import sisyphus.killPortage
import sisyphus.syncDatabase
-def start():
+def cliExec():
if sisyphus.checkEnvironment.root():
portageExec = subprocess.Popen(['emerge', '--quiet', '--depclean', '--ask'])
portageExec.wait()
@@ -16,10 +16,10 @@ def start():
else:
sys.exit("\nYou need root permissions to do this, exiting!\n")
-def startqt():
+def guiExec():
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.killPortage.start, portageExec)
+ atexit.register(sisyphus.killPortage.cliExec, 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 815eeb8..9aa9b51 100644
--- a/src/backend/installPkg.py
+++ b/src/backend/installPkg.py
@@ -15,9 +15,9 @@ import sisyphus.resolveDeps
import sisyphus.syncDatabase
import sisyphus.updateAll
-def start(pkgname):
+def cliExec(pkgname):
if sisyphus.checkEnvironment.root():
- sisyphus.updateAll.start()
+ sisyphus.updateAll.cliExec()
binhostURL = sisyphus.getEnvironment.binhostURL()
areBinaries,areSources,needsConfig = sisyphus.resolveDeps.package(pkgname)
@@ -62,7 +62,7 @@ def start(pkgname):
else:
sys.exit("\nYou need root permissions to do this, exiting!\n")
-def startqt(pkgname):
+def guiExec(pkgname):
binhostURL = sisyphus.getEnvironment.binhostURL()
areBinaries,areSources,needsConfig = sisyphus.resolveDeps.package.__wrapped__(pkgname) #undecorate
@@ -84,7 +84,7 @@ def startqt(pkgname):
portageExec = subprocess.Popen(['emerge', '--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.killPortage.start, portageExec)
+ atexit.register(sisyphus.killPortage.cliExec, portageExec)
for portageOutput in io.TextIOWrapper(portageExec.stdout, encoding="utf-8"):
if not "These are the packages that would be merged, in order:" in portageOutput.rstrip():
diff --git a/src/backend/installSrc.py b/src/backend/installSrc.py
index 0768902..d7a6cd3 100644
--- a/src/backend/installSrc.py
+++ b/src/backend/installSrc.py
@@ -13,9 +13,9 @@ import sisyphus.resolveDeps
import sisyphus.syncDatabase
import sisyphus.updateAll
-def start(pkgname):
+def cliExec(pkgname):
if sisyphus.checkEnvironment.root():
- sisyphus.updateAll.start()
+ sisyphus.updateAll.cliExec()
binhostURL = sisyphus.getEnvironment.binhostURL()
areBinaries,areSources,needsConfig = sisyphus.resolveDeps.package(pkgname)
diff --git a/src/backend/killPortage.py b/src/backend/killPortage.py
index f01af6b..c588252 100644
--- a/src/backend/killPortage.py
+++ b/src/backend/killPortage.py
@@ -1,4 +1,4 @@
#!/usr/bin/python3
-def start(portageCmd):
+def cliExec(portageCmd):
portageCmd.terminate()
diff --git a/src/backend/recoverDatabase.py b/src/backend/recoverDatabase.py
index 03e57a2..2594c72 100644
--- a/src/backend/recoverDatabase.py
+++ b/src/backend/recoverDatabase.py
@@ -6,7 +6,7 @@ import sisyphus.getFilesystem
import sisyphus.syncDatabase
@animation.wait('recovering databases')
-def start():
+def cliExec():
if os.path.exists(sisyphus.getFilesystem.remotePackagesCsv):
os.remove(sisyphus.getFilesystem.remotePackagesCsv)
if os.path.exists(sisyphus.getFilesystem.remoteDescriptionsCsv):
diff --git a/src/backend/searchPkg.py b/src/backend/searchPkg.py
index 6f227f9..8c5ea5b 100644
--- a/src/backend/searchPkg.py
+++ b/src/backend/searchPkg.py
@@ -124,9 +124,9 @@ 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 start(filter, cat, pn, desc, single):
+def cliExec(filter, cat, pn, desc, single):
if sisyphus.checkEnvironment.root():
- sisyphus.updateAll.start()
+ sisyphus.updateAll.cliExec()
else:
print("\nYou are not root, cannot fetch updates.\nSearch result may be inaccurate!\n")
diff --git a/src/backend/searchSrc.py b/src/backend/searchSrc.py
index c9b5862..5bd2279 100644
--- a/src/backend/searchSrc.py
+++ b/src/backend/searchSrc.py
@@ -2,5 +2,5 @@
import subprocess
-def start(pkgname):
+def cliExec(pkgname):
subprocess.call(['emerge', '--search', '--getbinpkg'] + list(pkgname))
diff --git a/src/backend/setBranch.py b/src/backend/setBranch.py
index 2633dd9..a2b1f62 100644
--- a/src/backend/setBranch.py
+++ b/src/backend/setBranch.py
@@ -79,16 +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 start(branch,remote):
+def cliExec(branch,remote):
if sisyphus.checkEnvironment.root():
sisyphus.purgeEnvironment.branch()
sisyphus.purgeEnvironment.metadata()
injectGentooRepo(branch,remote)
injectRedcoreRepo(branch,remote)
injectPortageConfigRepo(branch,remote)
- sisyphus.setJobs.start()
- sisyphus.setProfile.start()
+ sisyphus.setJobs.cliExec()
+ sisyphus.setProfile.cliExec()
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 5a22b10..89ccc37 100644
--- a/src/backend/setJobs.py
+++ b/src/backend/setJobs.py
@@ -2,5 +2,5 @@
import subprocess
-def start():
+def cliExec():
subprocess.call(['/usr/share/sisyphus/helpers/set_jobs'])
diff --git a/src/backend/setProfile.py b/src/backend/setProfile.py
index a5d6480..3a7f5e3 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 start():
+def cliExec():
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 c049c64..d7e5cdb 100644
--- a/src/backend/syncSPM.py
+++ b/src/backend/syncSPM.py
@@ -4,5 +4,5 @@ import animation
import sisyphus.syncDatabase
@animation.wait('syncing spm changes')
-def start():
+def cliExec():
sisyphus.syncDatabase.localTable()
diff --git a/src/backend/uninstallAll.py b/src/backend/uninstallAll.py
index b874738..4284867 100644
--- a/src/backend/uninstallAll.py
+++ b/src/backend/uninstallAll.py
@@ -27,7 +27,7 @@ def cliExecForce(pkgname):
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.killPortage.start, portageExec)
+ atexit.register(sisyphus.killPortage.cliExec, portageExec)
for portageOutput in io.TextIOWrapper(portageExec.stdout, encoding="utf-8"):
print(portageOutput.rstrip())
diff --git a/src/backend/updateAll.py b/src/backend/updateAll.py
index c5809ab..41d4a3a 100644
--- a/src/backend/updateAll.py
+++ b/src/backend/updateAll.py
@@ -17,7 +17,7 @@ def syncAll():
sisyphus.syncDatabase.remoteTable()
@animation.wait('fetching updates')
-def start():
+def cliExec():
activeBranch = sisyphus.checkEnvironment.branch()
binhostURL = sisyphus.getEnvironment.binhostURL()
isSane = sisyphus.checkEnvironment.sanity()
@@ -31,7 +31,7 @@ def start():
print("\nCurrent branch: '" + activeBranch + "' (testing)" + "\nCurrent binhost: '" + binhostURL + "' (stable)")
sys.exit("\nInvalid branch - binhost pairing; Use 'sisyphus branch --help' for help; Quitting.")
-def startqt():
+def guiExec():
activeBranch = sisyphus.checkEnvironment.branch()
binhostURL = sisyphus.getEnvironment.binhostURL()
isSane = sisyphus.checkEnvironment.sanity()
diff --git a/src/backend/upgradePkg.py b/src/backend/upgradePkg.py
index ccddd99..05d3674 100644
--- a/src/backend/upgradePkg.py
+++ b/src/backend/upgradePkg.py
@@ -15,9 +15,9 @@ import sisyphus.resolveDeps
import sisyphus.syncDatabase
import sisyphus.updateAll
-def start():
+def cliExec():
if sisyphus.checkEnvironment.root():
- sisyphus.updateAll.start()
+ sisyphus.updateAll.cliExec()
binhostURL = sisyphus.getEnvironment.binhostURL()
areBinaries,areSources,needsConfig = sisyphus.resolveDeps.world()
@@ -63,7 +63,7 @@ def start():
else:
sys.exit("\nYou need root permissions to do this, exiting!\n")
-def startqt():
+def guiExec():
binhostURL = sisyphus.getEnvironment.binhostURL()
areBinaries,areSources,needsConfig = sisyphus.resolveDeps.world.__wrapped__() #undecorate
@@ -89,7 +89,7 @@ def startqt():
portageExec = subprocess.Popen(['emerge', '--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.killPortage.start, portageExec)
+ atexit.register(sisyphus.killPortage.cliExec, portageExec)
for portageOutput in io.TextIOWrapper(portageExec.stdout, encoding="utf-8"):
if not "These are the packages that would be merged, in order:" in portageOutput.rstrip():
diff --git a/src/backend/upgradeSrc.py b/src/backend/upgradeSrc.py
index 1f50e18..edca120 100644
--- a/src/backend/upgradeSrc.py
+++ b/src/backend/upgradeSrc.py
@@ -13,9 +13,9 @@ import sisyphus.resolveDeps
import sisyphus.syncDatabase
import sisyphus.updateAll
-def start():
+def cliExec():
if sisyphus.checkEnvironment.root():
- sisyphus.updateAll.start()
+ sisyphus.updateAll.cliExec()
binhostURL = sisyphus.getEnvironment.binhostURL()
areBinaries,areSources,needsConfig = sisyphus.resolveDeps.world()
diff --git a/src/frontend/cli/sisyphus-cli.py b/src/frontend/cli/sisyphus-cli.py
index 69aaf5f..4ecfb71 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.start(filter.value, cat, pn, desc, quiet)
+ sisyphus.searchPkg.cliExec(filter.value, cat, pn, desc, quiet)
else:
if not package:
raise typer.Exit('No search term provided, try: sisyphus search --help')
else:
- sisyphus.searchSrc.start(package)
+ sisyphus.searchSrc.cliExec(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.start(pkgname)
+ sisyphus.installPkg.cliExec(pkgname)
else:
- sisyphus.installSrc.start(pkgname)
+ sisyphus.installSrc.cliExec(pkgname)
@app.command("uninstall")
def uninstall(pkgname: List[str], force: bool = typer.Option(False, "--force", "-f")):
@@ -172,13 +172,13 @@ def autoremove():
In addition, a package may no longer depend on another one, so that other package becomes orphan as well if nothing else requires it.
Use this option to check the whole dependency chain for such packages, and uninstall them.
"""
- sisyphus.autoRemoveAll.start()
+ sisyphus.autoRemoveAll.cliExec()
@app.command("update")
def update():
"""Update the Portage tree, the Redcore Overlay(s), Portage configs and Sisyphus's package database."""
if sisyphus.checkEnvironment.root():
- sisyphus.updateAll.start()
+ sisyphus.updateAll.cliExec()
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.start()
+ sisyphus.upgradePkg.cliExec()
else:
- sisyphus.upgradeSrc.start()
+ sisyphus.upgradeSrc.cliExec()
@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.start()
+ sisyphus.syncSPM.cliExec()
@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.recoverDatabase.start()
+ sisyphus.recoverDatabase.cliExec()
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.start(branch.value, remote.value)
+ sisyphus.setBranch.cliExec(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.start()
+ sisyphus.setJobs.cliExec()
app()
diff --git a/src/frontend/gui/sisyphus-gui.py b/src/frontend/gui/sisyphus-gui.py
index 41e0d01..c7c16ff 100644
--- a/src/frontend/gui/sisyphus-gui.py
+++ b/src/frontend/gui/sisyphus-gui.py
@@ -374,15 +374,15 @@ class MainWorker(QtCore.QObject):
@QtCore.pyqtSlot()
def startUpdate(self):
self.started.emit()
- sisyphus.setJobs.start()
- sisyphus.updateAll.startqt()
+ sisyphus.setJobs.cliExec()
+ sisyphus.updateAll.guiExec()
self.finished.emit()
@QtCore.pyqtSlot()
def startInstall(self):
self.started.emit()
pkgname = Sisyphus.pkgname
- sisyphus.installPkg.startqt(pkgname)
+ sisyphus.installPkg.guiExec(pkgname)
self.finished.emit()
@QtCore.pyqtSlot()
@@ -395,13 +395,13 @@ class MainWorker(QtCore.QObject):
@QtCore.pyqtSlot()
def startUpgrade(self):
self.started.emit()
- sisyphus.upgradePkg.startqt()
+ sisyphus.upgradePkg.guiExec()
self.finished.emit()
@QtCore.pyqtSlot()
def startAutoremove(self):
self.started.emit()
- sisyphus.autoRemoveAll.startqt()
+ sisyphus.autoRemoveAll.guiExec()
self.finished.emit()