summaryrefslogtreecommitdiff
path: root/src/backend
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/backend
parentbab41785dd6af2ecc88078dd22550b483e7fc776 (diff)
sisyphus-cli : plug more functions : install, uninstall, forceuninstall, update, upgrade, rescue, spmsync, autoremove - all work
Diffstat (limited to 'src/backend')
-rw-r--r--src/backend/__init__.py2
-rw-r--r--src/backend/autoremove.py (renamed from src/backend/removeorphans.py)0
-rw-r--r--src/backend/install.py12
-rw-r--r--src/backend/solvedeps.py4
-rw-r--r--src/backend/spmsync.py2
-rw-r--r--src/backend/uninstall.py4
-rw-r--r--src/backend/uninstallforce.py4
7 files changed, 15 insertions, 13 deletions
diff --git a/src/backend/__init__.py b/src/backend/__init__.py
index 3afa878..5a1e703 100644
--- a/src/backend/__init__.py
+++ b/src/backend/__init__.py
@@ -1,3 +1,4 @@
+from .autoremove import *
from .binhost import *
from .branchinject import *
from .branchmaster import *
@@ -13,7 +14,6 @@ from .install import *
from .killportage import *
from .metadata import *
from .mirror import *
-from .removeorphans import *
from .rescue import *
from .search import *
from .setjobs import *
diff --git a/src/backend/removeorphans.py b/src/backend/autoremove.py
index a0b4f30..a0b4f30 100644
--- a/src/backend/removeorphans.py
+++ b/src/backend/autoremove.py
diff --git a/src/backend/install.py b/src/backend/install.py
index cb13849..36704f3 100644
--- a/src/backend/install.py
+++ b/src/backend/install.py
@@ -12,11 +12,11 @@ import sisyphus.filesystem
import sisyphus.solvedeps
import sisyphus.update
-def start(pkgList):
+def start(pkgname):
sisyphus.update.start()
binhostURL = sisyphus.binhost.getURL()
- areBinaries,areSources,needsConfig = sisyphus.solvedeps.package(pkgList)
+ areBinaries,areSources,needsConfig = sisyphus.solvedeps.package(pkgname)
if needsConfig == 0:
if len(areSources) == 0:
@@ -44,7 +44,7 @@ def start(pkgList):
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'] + list(pkgname), stdout=subprocess.PIPE)
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():
@@ -83,7 +83,7 @@ def start(pkgList):
if os.path.exists(binary.rstrip().split("/")[1]):
os.remove(binary.rstrip().split("/")[1])
- portageExec = subprocess.Popen(['emerge', '--usepkg', '--rebuilt-binaries', '--misspell-suggestion=n', '--fuzzy-search=n'] + pkgList, stdout=subprocess.PIPE)
+ portageExec = subprocess.Popen(['emerge', '--usepkg', '--rebuilt-binaries', '--misspell-suggestion=n', '--fuzzy-search=n'] + list(pkgname), stdout=subprocess.PIPE)
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():
@@ -97,7 +97,7 @@ def start(pkgList):
else:
print("\n" + "These are the source packages that would be merged, in order:" + "\n\n" + str(areSources) + "\n\n" + "Total:" + " " + str(len(areSources)) + " " + "source package(s)" + "\n")
if input("Would you like to proceed?" + " " + "[y/N]" + " ").lower().strip()[:1] == "y":
- portageExec = subprocess.Popen(['emerge', '--misspell-suggestion=n', '--fuzzy-search=n'] + pkgList, stdout=subprocess.PIPE)
+ portageExec = subprocess.Popen(['emerge', '--misspell-suggestion=n', '--fuzzy-search=n'] + list(pkgname), stdout=subprocess.PIPE)
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():
@@ -109,7 +109,7 @@ def start(pkgList):
else:
sys.exit("\n" + "Ok; Quitting." + "\n")
else:
- portageExec = subprocess.Popen(['emerge', '--quiet', '--pretend', '--getbinpkg', '--rebuilt-binaries', '--misspell-suggestion=n', '--fuzzy-search=n'] + pkgList, stdout=subprocess.PIPE)
+ portageExec = subprocess.Popen(['emerge', '--quiet', '--pretend', '--getbinpkg', '--rebuilt-binaries', '--misspell-suggestion=n', '--fuzzy-search=n'] + list(pkgname), stdout=subprocess.PIPE)
for portageOutput in io.TextIOWrapper(portageExec.stdout, encoding="utf-8"):
if not "Local copy of remote index is up-to-date and will be used." in portageOutput.rstrip():
diff --git a/src/backend/solvedeps.py b/src/backend/solvedeps.py
index 256d588..074baf8 100644
--- a/src/backend/solvedeps.py
+++ b/src/backend/solvedeps.py
@@ -5,11 +5,11 @@ import subprocess
import io
@animation.wait('resolving dependencies')
-def package(pkgList):
+def package(pkgname):
areBinaries = []
areSources = []
needsConfig = int()
- portageExec = subprocess.Popen(['emerge', '--quiet', '--pretend', '--getbinpkg', '--rebuilt-binaries', '--misspell-suggestion=n', '--fuzzy-search=n'] + pkgList, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+ portageExec = subprocess.Popen(['emerge', '--quiet', '--pretend', '--getbinpkg', '--rebuilt-binaries', '--misspell-suggestion=n', '--fuzzy-search=n'] + list(pkgname), stdout=subprocess.PIPE, stderr=subprocess.PIPE)
for portageOutput in io.TextIOWrapper(portageExec.stderr, encoding="utf-8"):
if "The following keyword changes are necessary to proceed:" in portageOutput.rstrip():
diff --git a/src/backend/spmsync.py b/src/backend/spmsync.py
index 83f3089..2c388f1 100644
--- a/src/backend/spmsync.py
+++ b/src/backend/spmsync.py
@@ -1,6 +1,8 @@
#!/usr/bin/python3
+import animation
import sisyphus.database
+@animation.wait('syncing spm changes')
def start():
sisyphus.database.syncLocal()
diff --git a/src/backend/uninstall.py b/src/backend/uninstall.py
index 8dc9e34..1ceb0ba 100644
--- a/src/backend/uninstall.py
+++ b/src/backend/uninstall.py
@@ -4,8 +4,8 @@ import subprocess
import sisyphus.check
import sisyphus.sync
-def start(pkgList):
+def start(pkgname):
sisyphus.check.root()
- portageExec = subprocess.Popen(['emerge', '--quiet', '--depclean', '--ask'] + pkgList)
+ portageExec = subprocess.Popen(['emerge', '--quiet', '--depclean', '--ask'] + list(pkgname))
portageExec.wait()
sisyphus.database.syncLocal()
diff --git a/src/backend/uninstallforce.py b/src/backend/uninstallforce.py
index e3f4144..90de980 100644
--- a/src/backend/uninstallforce.py
+++ b/src/backend/uninstallforce.py
@@ -4,8 +4,8 @@ import subprocess
import sisyphus.check
import sisyphus.sync
-def start(pkgList):
+def start(pkgname):
sisyphus.check.root()
- portageExec = subprocess.Popen(['emerge', '--quiet', '--unmerge', '--ask'] + pkgList)
+ portageExec = subprocess.Popen(['emerge', '--quiet', '--unmerge', '--ask'] + list(pkgname))
portageExec.wait()
sisyphus.database.syncLocal()