summaryrefslogtreecommitdiff
path: root/src/frontend
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2020-06-09 20:45:02 +0100
committerV3n3RiX <venerix@redcorelinux.org>2020-06-09 20:45:02 +0100
commitc76a29a71d16e9ed512a22945d6e6b77b0d21fb6 (patch)
treec169e25c9d0fb66f4b6d7aa2c9d1d5950fc49f6c /src/frontend
parentbab41785dd6af2ecc88078dd22550b483e7fc776 (diff)
sisyphus-cli : plug more functions : install, uninstall, forceuninstall, update, upgrade, rescue, spmsync, autoremove - all work
Diffstat (limited to 'src/frontend')
-rwxr-xr-xsrc/frontend/cli/sisyphus-cli.py40
-rw-r--r--src/frontend/gui/sisyphus-gui.py14
2 files changed, 27 insertions, 27 deletions
diff --git a/src/frontend/cli/sisyphus-cli.py b/src/frontend/cli/sisyphus-cli.py
index 3d7a21f..7488922 100755
--- a/src/frontend/cli/sisyphus-cli.py
+++ b/src/frontend/cli/sisyphus-cli.py
@@ -23,23 +23,13 @@ def search(pkgname: List[str]):
"""Search for binary and/or ebuild (source) packages."""
sisyphus.search.start(pkgname)
-@app.command("update")
-def update():
- """Update the Portage tree, the Redcore Overlay(s), Portage configs and Sisyphus's package database."""
- typer.echo("Updating system ...")
-
-@app.command("upgrade")
-def upgrade():
- """Upgrade the system using binary and/or ebuild (source) packages."""
- typer.echo("Upgrading all packages ...")
-
@app.command("install")
-def install(pkglist: List[str]):
+def install(pkgname: List[str]):
"""Install binary and/or ebuild (source) packages."""
- [typer.echo(f"Installing {pkg}") for pkg in pkglist]
+ sisyphus.install.start(pkgname)
@app.command("uninstall")
-def uninstall(pkglist: List[str], force: bool = False):
+def uninstall(pkgname: List[str], force: bool = False):
"""Uninstall packages *SAFELY* by checking for reverse dependencies.
If reverse dependencies exist, the package(s) will NOT be uninstalled to prevent the possible breakage of the system.
If you really want to uninstall the package, make sure you uninstall all reverse dependencies as well.
@@ -51,9 +41,9 @@ def uninstall(pkglist: List[str], force: bool = False):
Upgrading the system may pull the packages back in, to fix the reverse dependency chain.
"""
if not force:
- [typer.echo(f"Safely removing {pkg}") for pkg in pkglist]
+ sisyphus.uninstall.start(pkgname)
else:
- [typer.echo(f"Force removing {pkg}") for pkg in pkglist]
+ sisyphus.uninstallforce.start(pkgname)
@app.command("autoremove")
def autoremove():
@@ -62,7 +52,17 @@ 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.
"""
- typer.echo("Performing cleanup ... ")
+ sisyphus.autoremove.start()
+
+@app.command("update")
+def update():
+ """Update the Portage tree, the Redcore Overlay(s), Portage configs and Sisyphus's package database."""
+ sisyphus.update.start()
+
+@app.command("upgrade")
+def upgrade():
+ """Upgrade the system using binary and/or ebuild (source) packages."""
+ sisyphus.upgrade.start()
@app.command("spmsync")
def spmsync():
@@ -70,7 +70,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.
"""
- typer.echo("Syncing sisyphus database ...")
+ sisyphus.spmsync.start()
@app.command("rescue")
def rescue():
@@ -79,10 +79,10 @@ 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.
"""
- typer.echo("Syncing sisyphus database ...")
+ sisyphus.rescue.start()
@app.command("branch")
-def branch(branch: str = typer.Argument('master'), remote: str = typer.Option('pagure')):
+def branch(branch: str = typer.Argument(...), remote: str = typer.Option(...)):
"""Pull the branch 'BRANCH' of the Portage tree, Redcore overlay and Portage configs,
using 'REMOTE' git repositories.
@@ -117,7 +117,7 @@ def sysinfo():
@mirrorSetup.command("list")
def mirrorlist():
- """List available binary package repository mirrors (* means active)."""
+ """List available binary package repository mirrors (the active one is marked with *)."""
sisyphus.mirror.printList()
@mirrorSetup.command("set")
diff --git a/src/frontend/gui/sisyphus-gui.py b/src/frontend/gui/sisyphus-gui.py
index a3f1375..5cc4fc8 100644
--- a/src/frontend/gui/sisyphus-gui.py
+++ b/src/frontend/gui/sisyphus-gui.py
@@ -245,7 +245,7 @@ class Sisyphus(QtWidgets.QMainWindow):
if not self.databaseTable.selectionModel().hasSelection():
self.statusBar().showMessage("No package selected, please pick at least one!")
else:
- Sisyphus.pkgList = self.getSelectedPackages()
+ Sisyphus.pkgname = self.getSelectedPackages()
self.statusBar().showMessage("I am installing requested package(s), please wait ...")
self.installThread.start()
@@ -253,7 +253,7 @@ class Sisyphus(QtWidgets.QMainWindow):
if not self.databaseTable.selectionModel().hasSelection():
self.statusBar().showMessage("No package selected, please pick at least one!")
else:
- Sisyphus.pkgList = self.getSelectedPackages()
+ Sisyphus.pkgname = self.getSelectedPackages()
self.statusBar().showMessage("I am removing requested package(s), please wait ...")
self.uninstallThread.start()
@@ -397,10 +397,10 @@ class MainWorker(QtCore.QObject):
@QtCore.pyqtSlot()
def startInstall(self):
self.started.emit()
- pkgList = Sisyphus.pkgList
+ pkgname = Sisyphus.pkgname
binhostURL = sisyphus.binhost.getURL()
- areBinaries,areSources,needsConfig = sisyphus.solvedeps.package.__wrapped__(pkgList) #undecorate
+ areBinaries,areSources,needsConfig = sisyphus.solvedeps.package.__wrapped__(pkgname) #undecorate
os.chdir(sisyphus.filesystem.portageCacheDir)
self.workerOutput.emit("\n" + "These are the binary packages that will be merged, in order:" + "\n\n" + str(areBinaries) + "\n\n" + "Total:" + " " + str(len(areBinaries)) + " " + "binary package(s)" + "\n\n")
@@ -424,7 +424,7 @@ class MainWorker(QtCore.QObject):
if os.path.exists(binary.rstrip().split("/")[1]):
os.remove(binary.rstrip().split("/")[1])
- portageExec = subprocess.Popen(['emerge', '--usepkg', '--usepkgonly', '--rebuilt-binaries', '--misspell-suggestion=n', '--fuzzy-search=n'] + pkgList, stdout=subprocess.PIPE)
+ portageExec = subprocess.Popen(['emerge', '--usepkg', '--usepkgonly', '--rebuilt-binaries', '--misspell-suggestion=n', '--fuzzy-search=n'] + pkgname, stdout=subprocess.PIPE)
# kill portage if the program dies or it's terminated by the user
atexit.register(sisyphus.killportage.start, portageExec)
@@ -441,8 +441,8 @@ class MainWorker(QtCore.QObject):
@QtCore.pyqtSlot()
def startUninstall(self):
self.started.emit()
- pkgList = Sisyphus.pkgList
- portageExec = subprocess.Popen(['emerge', '--depclean'] + pkgList, stdout=subprocess.PIPE)
+ pkgname = Sisyphus.pkgname
+ portageExec = subprocess.Popen(['emerge', '--depclean'] + pkgname, stdout=subprocess.PIPE)
# kill portage if the program dies or it's terminated by the user
atexit.register(sisyphus.killportage.start, portageExec)