From 100226c624cdf8b3b1210c124b0b1ee6a3b3d816 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Sun, 30 Oct 2022 15:54:58 +0000 Subject: various cleanups --- src/backend/__init__.py | 3 +- src/backend/autoremove.py | 2 +- src/backend/installpkg.py | 8 +-- src/backend/installsrc.py | 4 +- src/backend/killemerge.py | 2 +- src/backend/recoverdb.py | 2 +- src/backend/search.py | 137 +++++++++++++++++++++++++++++++++++++++ src/backend/searchpkg.py | 133 ------------------------------------- src/backend/searchsrc.py | 6 -- src/backend/setbranch.py | 6 +- src/backend/setjobs.py | 2 +- src/backend/setprofile.py | 2 +- src/backend/syncspm.py | 2 +- src/backend/uninstall.py | 8 +-- src/backend/update.py | 4 +- src/backend/upgradepkg.py | 8 +-- src/backend/upgradesrc.py | 4 +- src/frontend/cli/sisyphus-cli.py | 26 ++++---- src/frontend/gui/sisyphus-gui.py | 10 +-- 19 files changed, 183 insertions(+), 186 deletions(-) create mode 100644 src/backend/search.py delete mode 100644 src/backend/searchpkg.py delete mode 100644 src/backend/searchsrc.py (limited to 'src') 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/search.py b/src/backend/search.py new file mode 100644 index 0000000..d718c7e --- /dev/null +++ b/src/backend/search.py @@ -0,0 +1,137 @@ +#!/usr/bin/python3 + +import sqlite3 +import subprocess +import sisyphus.checkenv +import sisyphus.getfs +import sisyphus.update + +def searchDB(filter, cat = '', pn = '', desc = ''): + NOVIRT = "AND cat NOT LIKE 'virtual'" + SELECTS = { + 'all': f'''SELECT + i.category AS cat, + i.name as pn, + i.version as iv, + IFNULL(a.version, 'alien') AS av, + d.description AS desc + FROM local_packages AS i LEFT OUTER JOIN remote_packages as a + ON i.category = a.category + AND i.name = a.name + AND i.slot = a.slot + LEFT JOIN remote_descriptions AS d ON i.name = d.name AND i.category = d.category + WHERE cat LIKE '%{cat}%' AND pn LIKE '%{pn}%' AND desc LIKE '%{desc}%' {NOVIRT} + UNION + SELECT + a.category AS cat, + a.name as pn, + IFNULL(i.version, 'None') AS iv, + a.version as av, + d.description AS desc + FROM remote_packages AS a LEFT OUTER JOIN local_packages AS i + ON a.category = i.category + AND a.name = i.name + AND a.slot = i.slot + LEFT JOIN remote_descriptions AS d ON a.name = d.name AND a.category = d.category + WHERE cat LIKE '%{cat}%' AND pn LIKE '%{pn}%' AND desc LIKE '%{desc}%' {NOVIRT}''', + 'installed': f'''SELECT + i.category AS cat, + i.name AS pn, + i.version AS iv, + a.version as av, + d.description AS desc + FROM local_packages AS i + LEFT JOIN remote_packages AS a + ON i.category = a.category + AND i.name = a.name + AND i.slot = a.slot + LEFT JOIN remote_descriptions AS d ON i.name = d.name AND i.category = d.category + WHERE cat LIKE '%{cat}%' AND pn LIKE '%{pn}%' AND desc LIKE '%{desc}%' {NOVIRT}''', + 'alien': f'''SELECT + i.category AS cat, + i.name AS pn, + i.version as iv, + IFNULL(a.version, 'alien') AS av, + d.description AS desc + FROM local_packages AS i + LEFT JOIN remote_packages AS a + ON a.category = i.category + AND a.name = i.name + AND a.slot = i.slot + LEFT JOIN remote_descriptions AS d ON i.name = d.name AND i.category = d.category + WHERE cat LIKE '%{cat}%' AND pn LIKE '%{pn}%' AND desc LIKE '%{desc}%' {NOVIRT} + AND av IS 'alien' ''', + 'available': f'''SELECT + a.category AS cat, + a.name AS pn, + i.version as iv, + a.version AS av, + d.description AS desc + FROM remote_packages AS a + LEFT JOIN local_packages AS i + ON a.category = i.category + AND a.name = i.name + AND a.slot = i.slot + LEFT JOIN remote_descriptions AS d ON a.name = d.name AND a.category = d.category + WHERE cat LIKE '%{cat}%' AND pn LIKE '%{pn}%' AND desc LIKE '%{desc}%' {NOVIRT} + AND iv IS NULL''', + 'upgradable': f'''SELECT + i.category AS cat, + i.name AS pn, + i.version as iv, + a.version AS av, + d.description AS desc + FROM local_packages AS i + INNER JOIN remote_packages AS a + ON i.category = a.category + AND i.name = a.name + AND i.slot = a.slot + LEFT JOIN remote_descriptions AS d ON i.name = d.name AND i.category = d.category + WHERE cat LIKE '%{cat}%' AND pn LIKE '%{pn}%' AND desc LIKE '%{desc}%' {NOVIRT} + AND iv <> av''' + } + + with sqlite3.connect(sisyphus.getfs.localDatabase) as db: + db.row_factory = sqlite3.Row + cursor = db.cursor() + cursor.execute(SELECTS[filter]) + rows = cursor.fetchall() + + return rows + +def tosql(string): + return '%%' if string == '' else string.replace('*', '%').replace('?', '_') + +def showSearch(filter, cat, pn, desc, single): + print(f"Searching {filter} packages ... \n") + pkglist = searchDB(filter, tosql(cat), tosql(pn), tosql(desc)) + + if len(pkglist) == 0: + print("No package found!\nUse the '--ebuild' option to search for source packages!") + else: + if single: + print(f"{'Package':45} {'Installed':20} Available") + for pkg in pkglist: + if not single: + print(f"* {pkg['cat']}/{pkg['pn']}") + print(f"\tInstalled version: {pkg['iv']}") + if pkg['av'] != 'alien': + print(f"\tLatest available version: {pkg['av']}") + else: + print(f"\tAlien package: Use `sisyphus search --ebuild {pkg['pn']}` for available version!") + print(f"\tDescription: {pkg['desc']}\n") + else: + cpn = f"{pkg['cat']}/{pkg['pn']}" + 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): + if sisyphus.checkenv.root(): + 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/searchpkg.py b/src/backend/searchpkg.py deleted file mode 100644 index e0c33c6..0000000 --- a/src/backend/searchpkg.py +++ /dev/null @@ -1,133 +0,0 @@ -#!/usr/bin/python3 - -import sqlite3 -import sisyphus.checkenv -import sisyphus.getfs -import sisyphus.update - -def searchDB(filter, cat = '', pn = '', desc = ''): - NOVIRT = "AND cat NOT LIKE 'virtual'" - SELECTS = { - 'all': f'''SELECT - i.category AS cat, - i.name as pn, - i.version as iv, - IFNULL(a.version, 'alien') AS av, - d.description AS desc - FROM local_packages AS i LEFT OUTER JOIN remote_packages as a - ON i.category = a.category - AND i.name = a.name - AND i.slot = a.slot - LEFT JOIN remote_descriptions AS d ON i.name = d.name AND i.category = d.category - WHERE cat LIKE '%{cat}%' AND pn LIKE '%{pn}%' AND desc LIKE '%{desc}%' {NOVIRT} - UNION - SELECT - a.category AS cat, - a.name as pn, - IFNULL(i.version, 'None') AS iv, - a.version as av, - d.description AS desc - FROM remote_packages AS a LEFT OUTER JOIN local_packages AS i - ON a.category = i.category - AND a.name = i.name - AND a.slot = i.slot - LEFT JOIN remote_descriptions AS d ON a.name = d.name AND a.category = d.category - WHERE cat LIKE '%{cat}%' AND pn LIKE '%{pn}%' AND desc LIKE '%{desc}%' {NOVIRT}''', - 'installed': f'''SELECT - i.category AS cat, - i.name AS pn, - i.version AS iv, - a.version as av, - d.description AS desc - FROM local_packages AS i - LEFT JOIN remote_packages AS a - ON i.category = a.category - AND i.name = a.name - AND i.slot = a.slot - LEFT JOIN remote_descriptions AS d ON i.name = d.name AND i.category = d.category - WHERE cat LIKE '%{cat}%' AND pn LIKE '%{pn}%' AND desc LIKE '%{desc}%' {NOVIRT}''', - 'alien': f'''SELECT - i.category AS cat, - i.name AS pn, - i.version as iv, - IFNULL(a.version, 'alien') AS av, - d.description AS desc - FROM local_packages AS i - LEFT JOIN remote_packages AS a - ON a.category = i.category - AND a.name = i.name - AND a.slot = i.slot - LEFT JOIN remote_descriptions AS d ON i.name = d.name AND i.category = d.category - WHERE cat LIKE '%{cat}%' AND pn LIKE '%{pn}%' AND desc LIKE '%{desc}%' {NOVIRT} - AND av IS 'alien' ''', - 'available': f'''SELECT - a.category AS cat, - a.name AS pn, - i.version as iv, - a.version AS av, - d.description AS desc - FROM remote_packages AS a - LEFT JOIN local_packages AS i - ON a.category = i.category - AND a.name = i.name - AND a.slot = i.slot - LEFT JOIN remote_descriptions AS d ON a.name = d.name AND a.category = d.category - WHERE cat LIKE '%{cat}%' AND pn LIKE '%{pn}%' AND desc LIKE '%{desc}%' {NOVIRT} - AND iv IS NULL''', - 'upgradable': f'''SELECT - i.category AS cat, - i.name AS pn, - i.version as iv, - a.version AS av, - d.description AS desc - FROM local_packages AS i - INNER JOIN remote_packages AS a - ON i.category = a.category - AND i.name = a.name - AND i.slot = a.slot - LEFT JOIN remote_descriptions AS d ON i.name = d.name AND i.category = d.category - WHERE cat LIKE '%{cat}%' AND pn LIKE '%{pn}%' AND desc LIKE '%{desc}%' {NOVIRT} - AND iv <> av''' - } - - with sqlite3.connect(sisyphus.getfs.localDatabase) as db: - db.row_factory = sqlite3.Row - cursor = db.cursor() - cursor.execute(SELECTS[filter]) - rows = cursor.fetchall() - - return rows - -def tosql(string): - return '%%' if string == '' else string.replace('*', '%').replace('?', '_') - -def showSearch(filter, cat, pn, desc, single): - print(f"Searching {filter} packages ... \n") - pkglist = searchDB(filter, tosql(cat), tosql(pn), tosql(desc)) - - if len(pkglist) == 0: - print("No package found!\nUse the '--ebuild' option to search for source packages!") - else: - if single: - print(f"{'Package':45} {'Installed':20} Available") - for pkg in pkglist: - if not single: - print(f"* {pkg['cat']}/{pkg['pn']}") - print(f"\tInstalled version: {pkg['iv']}") - if pkg['av'] != 'alien': - print(f"\tLatest available version: {pkg['av']}") - else: - print(f"\tAlien package: Use `sisyphus search --ebuild {pkg['pn']}` for available version!") - print(f"\tDescription: {pkg['desc']}\n") - else: - cpn = f"{pkg['cat']}/{pkg['pn']}" - 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): - if sisyphus.checkenv.root(): - sisyphus.update.cliExec() - else: - print("\nYou are not root, cannot fetch updates.\nSearch result may be inaccurate!\n") - - showSearch(filter, cat, pn, desc, single) 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() -- cgit v1.2.3