From d5fcb065ad5442e20517ff35508c6b4b8ca59ef1 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Sun, 30 Oct 2022 14:41:24 +0000 Subject: move resolveDeps -> solvedeps --- src/backend/__init__.py | 2 +- src/backend/installPkg.py | 6 ++-- src/backend/installSrc.py | 4 +-- src/backend/resolveDeps.py | 68 ---------------------------------------------- src/backend/solvedeps.py | 68 ++++++++++++++++++++++++++++++++++++++++++++++ src/backend/upgradePkg.py | 6 ++-- src/backend/upgradeSrc.py | 4 +-- 7 files changed, 79 insertions(+), 79 deletions(-) delete mode 100644 src/backend/resolveDeps.py create mode 100644 src/backend/solvedeps.py diff --git a/src/backend/__init__.py b/src/backend/__init__.py index 7467185..238a194 100644 --- a/src/backend/__init__.py +++ b/src/backend/__init__.py @@ -7,7 +7,7 @@ from .installSrc import * from .killemerge import * from .purgeenv import * from .recoverdb import * -from .resolveDeps import * +from .solvedeps import * from .searchPkg import * from .searchSrc import * from .setBranch import * diff --git a/src/backend/installPkg.py b/src/backend/installPkg.py index 55af933..1e2f51e 100644 --- a/src/backend/installPkg.py +++ b/src/backend/installPkg.py @@ -11,7 +11,7 @@ import sisyphus.checkenv import sisyphus.getenv import sisyphus.getfs import sisyphus.killemerge -import sisyphus.resolveDeps +import sisyphus.solvedeps import sisyphus.syncDatabase import sisyphus.updateAll @@ -20,7 +20,7 @@ def cliExec(pkgname): sisyphus.updateAll.cliExec() binhostURL = sisyphus.getenv.binhostURL() - areBinaries,areSources,needsConfig = sisyphus.resolveDeps.package(pkgname) + areBinaries,areSources,needsConfig = sisyphus.solvedeps.package(pkgname) if needsConfig == 0: if len(areSources) == 0: @@ -60,7 +60,7 @@ def cliExec(pkgname): def guiExec(pkgname): binhostURL = sisyphus.getenv.binhostURL() - areBinaries,areSources,needsConfig = sisyphus.resolveDeps.package.__wrapped__(pkgname) #undecorate + areBinaries,areSources,needsConfig = sisyphus.solvedeps.package.__wrapped__(pkgname) #undecorate os.chdir(sisyphus.getfs.portageCacheDir) print("\n" + "These are the binary packages that will be merged, in order:" + "\n\n" + " ".join(areBinaries) + "\n\n" + "Total:" + " " + str(len(areBinaries)) + " " + "binary package(s)" + "\n\n") diff --git a/src/backend/installSrc.py b/src/backend/installSrc.py index 6abc7b2..d860c20 100644 --- a/src/backend/installSrc.py +++ b/src/backend/installSrc.py @@ -9,7 +9,7 @@ import wget import sisyphus.checkenv import sisyphus.getenv import sisyphus.getfs -import sisyphus.resolveDeps +import sisyphus.solvedeps import sisyphus.syncDatabase import sisyphus.updateAll @@ -18,7 +18,7 @@ def cliExec(pkgname): sisyphus.updateAll.cliExec() binhostURL = sisyphus.getenv.binhostURL() - areBinaries,areSources,needsConfig = sisyphus.resolveDeps.package(pkgname) + areBinaries,areSources,needsConfig = sisyphus.solvedeps.package(pkgname) if needsConfig == 0: if len(areSources) == 0: diff --git a/src/backend/resolveDeps.py b/src/backend/resolveDeps.py deleted file mode 100644 index 41e9103..0000000 --- a/src/backend/resolveDeps.py +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/python3 - -import animation -import subprocess - -@animation.wait('resolving dependencies') -def package(pkgname): - areBinaries = [] - areSources = [] - needsConfig = int() - portageExec = subprocess.Popen(['emerge', '--quiet', '--pretend', '--getbinpkg', '--rebuilt-binaries', '--with-bdeps=y', '--misspell-suggestion=n', '--fuzzy-search=n'] + list(pkgname), stdout=subprocess.PIPE, stderr=subprocess.PIPE) - stdout, stderr = portageExec.communicate() - - for portageOutput in stderr.decode('utf-8').splitlines(): - if "The following keyword changes are necessary to proceed:" in portageOutput: - needsConfig = int(1) - - if "The following mask changes are necessary to proceed:" in portageOutput: - needsConfig = int(1) - - if "The following USE changes are necessary to proceed:" in portageOutput: - needsConfig = int(1) - - if "The following REQUIRED_USE flag constraints are unsatisfied:" in portageOutput: - needsConfig = int(1) - - for portageOutput in stdout.decode('utf-8').splitlines(): - if "[binary" in portageOutput: - isBinary = portageOutput.split("]")[1].split("[")[0].strip(" ") - areBinaries.append(isBinary) - - if "[ebuild" in portageOutput: - isSource = portageOutput.split("]")[1].split("[")[0].strip(" ") - areSources.append(isSource) - - return areBinaries,areSources,needsConfig - -@animation.wait('resolving dependencies') -def world(): - areBinaries = [] - areSources = [] - needsConfig = int() - 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, stderr=subprocess.PIPE) - stdout, stderr = portageExec.communicate() - - for portageOutput in stderr.decode('utf-8').splitlines(): - if "The following keyword changes are necessary to proceed:" in portageOutput: - needsConfig = int(1) - - if "The following mask changes are necessary to proceed:" in portageOutput: - needsConfig = int(1) - - if "The following USE changes are necessary to proceed:" in portageOutput: - needsConfig = int(1) - - if "The following REQUIRED_USE flag constraints are unsatisfied:" in portageOutput: - needsConfig = int(1) - - for portageOutput in stdout.decode('utf-8').splitlines(): - if "[binary" in portageOutput: - isBinary = portageOutput.split("]")[1].split("[")[0].strip(" ") - areBinaries.append(isBinary) - - if "[ebuild" in portageOutput: - isSource = portageOutput.split("]")[1].split("[")[0].strip(" ") - areSources.append(isSource) - - return areBinaries,areSources,needsConfig diff --git a/src/backend/solvedeps.py b/src/backend/solvedeps.py new file mode 100644 index 0000000..41e9103 --- /dev/null +++ b/src/backend/solvedeps.py @@ -0,0 +1,68 @@ +#!/usr/bin/python3 + +import animation +import subprocess + +@animation.wait('resolving dependencies') +def package(pkgname): + areBinaries = [] + areSources = [] + needsConfig = int() + portageExec = subprocess.Popen(['emerge', '--quiet', '--pretend', '--getbinpkg', '--rebuilt-binaries', '--with-bdeps=y', '--misspell-suggestion=n', '--fuzzy-search=n'] + list(pkgname), stdout=subprocess.PIPE, stderr=subprocess.PIPE) + stdout, stderr = portageExec.communicate() + + for portageOutput in stderr.decode('utf-8').splitlines(): + if "The following keyword changes are necessary to proceed:" in portageOutput: + needsConfig = int(1) + + if "The following mask changes are necessary to proceed:" in portageOutput: + needsConfig = int(1) + + if "The following USE changes are necessary to proceed:" in portageOutput: + needsConfig = int(1) + + if "The following REQUIRED_USE flag constraints are unsatisfied:" in portageOutput: + needsConfig = int(1) + + for portageOutput in stdout.decode('utf-8').splitlines(): + if "[binary" in portageOutput: + isBinary = portageOutput.split("]")[1].split("[")[0].strip(" ") + areBinaries.append(isBinary) + + if "[ebuild" in portageOutput: + isSource = portageOutput.split("]")[1].split("[")[0].strip(" ") + areSources.append(isSource) + + return areBinaries,areSources,needsConfig + +@animation.wait('resolving dependencies') +def world(): + areBinaries = [] + areSources = [] + needsConfig = int() + 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, stderr=subprocess.PIPE) + stdout, stderr = portageExec.communicate() + + for portageOutput in stderr.decode('utf-8').splitlines(): + if "The following keyword changes are necessary to proceed:" in portageOutput: + needsConfig = int(1) + + if "The following mask changes are necessary to proceed:" in portageOutput: + needsConfig = int(1) + + if "The following USE changes are necessary to proceed:" in portageOutput: + needsConfig = int(1) + + if "The following REQUIRED_USE flag constraints are unsatisfied:" in portageOutput: + needsConfig = int(1) + + for portageOutput in stdout.decode('utf-8').splitlines(): + if "[binary" in portageOutput: + isBinary = portageOutput.split("]")[1].split("[")[0].strip(" ") + areBinaries.append(isBinary) + + if "[ebuild" in portageOutput: + isSource = portageOutput.split("]")[1].split("[")[0].strip(" ") + areSources.append(isSource) + + return areBinaries,areSources,needsConfig diff --git a/src/backend/upgradePkg.py b/src/backend/upgradePkg.py index 63a6973..566ff85 100644 --- a/src/backend/upgradePkg.py +++ b/src/backend/upgradePkg.py @@ -11,7 +11,7 @@ import sisyphus.checkenv import sisyphus.getenv import sisyphus.getfs import sisyphus.killemerge -import sisyphus.resolveDeps +import sisyphus.solvedeps import sisyphus.syncDatabase import sisyphus.updateAll @@ -20,7 +20,7 @@ def cliExec(): sisyphus.updateAll.cliExec() binhostURL = sisyphus.getenv.binhostURL() - areBinaries,areSources,needsConfig = sisyphus.resolveDeps.world() + areBinaries,areSources,needsConfig = sisyphus.solvedeps.world() if needsConfig == 0: if len(areSources) == 0: @@ -60,7 +60,7 @@ def cliExec(): def guiExec(): binhostURL = sisyphus.getenv.binhostURL() - areBinaries,areSources,needsConfig = sisyphus.resolveDeps.world.__wrapped__() #undecorate + areBinaries,areSources,needsConfig = sisyphus.solvedeps.world.__wrapped__() #undecorate if not len(areSources) == 0: print("\n" + "Source package(s) found in the mix;" + " " + "Use sisyphus CLI:" + " " + "'" + "sisyphus upgrade --ebuild" + "'" + " " + "to perform the upgrade;" + " " + "Aborting." + "\n") diff --git a/src/backend/upgradeSrc.py b/src/backend/upgradeSrc.py index 4f06cd2..2d88dac 100644 --- a/src/backend/upgradeSrc.py +++ b/src/backend/upgradeSrc.py @@ -9,7 +9,7 @@ import wget import sisyphus.checkenv import sisyphus.getenv import sisyphus.getfs -import sisyphus.resolveDeps +import sisyphus.solvedeps import sisyphus.syncDatabase import sisyphus.updateAll @@ -18,7 +18,7 @@ def cliExec(): sisyphus.updateAll.cliExec() binhostURL = sisyphus.getenv.binhostURL() - areBinaries,areSources,needsConfig = sisyphus.resolveDeps.world() + areBinaries,areSources,needsConfig = sisyphus.solvedeps.world() if needsConfig == 0: if len(areSources) == 0: -- cgit v1.2.3