summaryrefslogtreecommitdiff
path: root/src/backend/libsisyphus.py
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2018-11-11 00:52:18 +0000
committerV3n3RiX <venerix@redcorelinux.org>2018-11-11 00:52:18 +0000
commitd4aac801bf44fbad975fbadf1807d73291b09dde (patch)
tree3a07f4dcf35a31a308072fa4a4740e2e1d6aba66 /src/backend/libsisyphus.py
parent05f1fa8cc99c5d8a2199ef4fa8ae272cc2aac078 (diff)
implement first bits for hybrid installs
Diffstat (limited to 'src/backend/libsisyphus.py')
-rw-r--r--src/backend/libsisyphus.py26
1 files changed, 24 insertions, 2 deletions
diff --git a/src/backend/libsisyphus.py b/src/backend/libsisyphus.py
index b0d07de..51d61c5 100644
--- a/src/backend/libsisyphus.py
+++ b/src/backend/libsisyphus.py
@@ -65,7 +65,7 @@ def getRemoteDscsURL():
remoteDscsURL = str(portageOutput.rstrip().split("=")[1].strip('\"').replace('packages', 'csv') + 'remoteDescriptionsPre.csv')
return remoteDscsURL
-@animation.wait('resolving dependencies')
+@animation.wait('resolving binary dependencies')
def getPkgBinaryDeps(pkgList):
binaryDeps = []
portageExec = subprocess.Popen(['emerge', '--quiet', '--pretend', '--getbinpkg', '--rebuilt-binaries', '--misspell-suggestion=n', '--fuzzy-search=n'] + pkgList, stdout=subprocess.PIPE)
@@ -76,7 +76,18 @@ def getPkgBinaryDeps(pkgList):
binaryDeps.append(binaryDep)
return binaryDeps
-@animation.wait('resolving dependencies')
+@animation.wait('resolving source dependencies')
+def getPkgSourceDeps(pkgList):
+ sourceDeps = []
+ portageExec = subprocess.Popen(['emerge', '--quiet', '--pretend', '--getbinpkg', '--rebuilt-binaries', '--misspell-suggestion=n', '--fuzzy-search=n'] + pkgList, stdout=subprocess.PIPE)
+
+ for portageOutput in io.TextIOWrapper(portageExec.stdout, encoding="utf-8"):
+ if "ebuild" in portageOutput.rstrip():
+ sourceDep = str(portageOutput.rstrip().split("]")[1].split("[")[0].strip("\ "))
+ sourceDeps.append(sourceDep)
+ return sourceDeps
+
+@animation.wait('resolving binary dependencies')
def getWorldBinaryDeps():
binaryDeps = []
portageExec = subprocess.Popen(['emerge', '--quiet', '--update', '--deep', '--newuse', '--pretend', '--getbinpkg', '--rebuilt-binaries', '--backtrack=100', '--with-bdeps=y', '--misspell-suggestion=n', '--fuzzy-search=n', '@world'], stdout=subprocess.PIPE)
@@ -87,6 +98,17 @@ def getWorldBinaryDeps():
binaryDeps.append(binaryDep)
return binaryDeps
+@animation.wait('resolving source dependencies')
+def getWorldSourceDeps():
+ sourceDeps = []
+ portageExec = subprocess.Popen(['emerge', '--quiet', '--update', '--deep', '--newuse', '--pretend', '--getbinpkg', '--rebuilt-binaries', '--backtrack=100', '--with-bdeps=y', '--misspell-suggestion=n', '--fuzzy-search=n', '@world'], stdout=subprocess.PIPE)
+
+ for portageOutput in io.TextIOWrapper(portageExec.stdout, encoding="utf-8"):
+ if "ebuild" in portageOutput.rstrip():
+ sourceDep = str(portageOutput.rstrip().split("]")[1].split("[")[0].strip("\ "))
+ sourceDeps.append(sourceDep)
+ return sourceDeps
+
def fetchRemoteDatabase():
remotePkgsURL = getRemotePkgsURL()
remoteDscsURL = getRemoteDscsURL()