From d4aac801bf44fbad975fbadf1807d73291b09dde Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Sun, 11 Nov 2018 00:52:18 +0000 Subject: implement first bits for hybrid installs --- src/backend/libsisyphus.py | 26 ++++++++++++++++++++++++-- 1 file 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() -- cgit v1.2.3