diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2019-02-27 00:04:25 +0000 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2019-02-27 00:04:25 +0000 |
commit | 797a3e52e7fcee4cbfbefba9abf6c7ad8282dfd6 (patch) | |
tree | d1129f017fdca5ca5f8e33912860ebfaaf302dac /src | |
parent | d0a1f14a8bd47cef979cc687215e9431eb910f6a (diff) |
read portage's stderr, and expose it for our own use
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/libsisyphus.py | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/src/backend/libsisyphus.py b/src/backend/libsisyphus.py index b8257e0..1fd9eab 100644 --- a/src/backend/libsisyphus.py +++ b/src/backend/libsisyphus.py @@ -66,7 +66,15 @@ def getCsvUrl(): def getPackageDeps(pkgList): areBinaries = [] areSources = [] - portageExec = subprocess.Popen(['emerge', '--quiet', '--pretend', '--getbinpkg', '--rebuilt-binaries', '--misspell-suggestion=n', '--fuzzy-search=n'] + pkgList, stdout=subprocess.PIPE) + needsConfig = int() + portageExec = subprocess.Popen(['emerge', '--quiet', '--pretend', '--getbinpkg', '--rebuilt-binaries', '--misspell-suggestion=n', '--fuzzy-search=n'] + pkgList, 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(): + needsConfig = int(1) + + if "The following mask changes are necessary to proceed:" in portageOutput.rstrip(): + needsConfig = int(1) for portageOutput in io.TextIOWrapper(portageExec.stdout, encoding="utf-8"): if "binary" in portageOutput.rstrip(): @@ -76,13 +84,21 @@ def getPackageDeps(pkgList): if "ebuild" in portageOutput.rstrip(): isSource = str(portageOutput.rstrip().split("]")[1].split("[")[0].strip("\ ")) areSources.append(isSource) - return areBinaries,areSources + return areBinaries,areSources,needsConfig @animation.wait('resolving dependencies') def getWorldDeps(): areBinaries = [] areSources = [] - 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) + 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) + + for portageOutput in io.TextIOWrapper(portageExec.stderr, encoding="utf-8"): + if "The following keyword changes are necessary to proceed:" in portageOutput.rstrip(): + needsConfig = int(1) + + if "The following mask changes are necessary to proceed:" in portageOutput.rstrip(): + needsConfig = int(1) for portageOutput in io.TextIOWrapper(portageExec.stdout, encoding="utf-8"): if "binary" in portageOutput.rstrip(): @@ -92,7 +108,7 @@ def getWorldDeps(): if "ebuild" in portageOutput.rstrip(): isSource = str(portageOutput.rstrip().split("]")[1].split("[")[0].strip("\ ")) areSources.append(isSource) - return areBinaries,areSources + return areBinaries,areSources,needsConfig def fetchRemoteDatabase(): remotePkgCsv,remoteDescCsv = getCsvUrl() |