summaryrefslogtreecommitdiff
path: root/src/backend
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 /src/backend
parentde363a67dd99fa1395be5a5ce8d9a75472d81997 (diff)
various cleanups
Diffstat (limited to 'src/backend')
-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
16 files changed, 34 insertions, 37 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()