summaryrefslogtreecommitdiff
path: root/src/backend/csvfiles.py
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2021-01-31 01:20:32 +0000
committerV3n3RiX <venerix@redcorelinux.org>2021-01-31 01:20:32 +0000
commite5d40ebec925b9e0f308fa55930f7fd03f02a693 (patch)
treeb3ff6dcffc9c956419466bf37b66296bd18ba438 /src/backend/csvfiles.py
parente4f2e722b2740d16ddc2ffa9b184287a7850b203 (diff)
Revert "backend : reuse binhost module in csvfiles module, one less portage call"
This reverts commit e4f2e722b2740d16ddc2ffa9b184287a7850b203.
Diffstat (limited to 'src/backend/csvfiles.py')
-rw-r--r--src/backend/csvfiles.py20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/backend/csvfiles.py b/src/backend/csvfiles.py
index 0d2e895..0c91e81 100644
--- a/src/backend/csvfiles.py
+++ b/src/backend/csvfiles.py
@@ -1,17 +1,21 @@
#!/usr/bin/python3
-import sisyphus.binhost
+import subprocess
+import io
def getURL():
remotePackagesCsvURL = []
remoteDescriptionsCsvURL = []
- binhostURL = sisyphus.binhost.getURL()
+ portageExec = subprocess.Popen(['emerge', '--info', '--verbose'], stdout=subprocess.PIPE)
- if "packages-next" in binhostURL:
- remotePackagesCsvURL = binhostURL.replace('packages-next', 'csv-next') + 'remotePackagesPre.csv'
- remoteDescriptionsCsvURL = binhostURL.replace('packages-next', 'csv-next') + 'remoteDescriptionsPre.csv'
- else:
- remotePackagesCsvURL = binhostURL.replace('packages', 'csv') + 'remotePackagesPre.csv'
- remoteDescriptionsCsvURL = binhostURL.replace('packages', 'csv') + 'remoteDescriptionsPre.csv'
+ for portageOutput in io.TextIOWrapper(portageExec.stdout, encoding="utf-8"):
+ if "PORTAGE_BINHOST" in portageOutput.rstrip():
+ if "packages-next" in portageOutput.rstrip():
+ remotePackagesCsvURL = str(portageOutput.rstrip().split("=")[1].strip('\"').replace('packages-next', 'csv-next') + 'remotePackagesPre.csv')
+ remoteDescriptionsCsvURL = str(portageOutput.rstrip().split("=")[1].strip('\"').replace('packages-next', 'csv-next') + 'remoteDescriptionsPre.csv')
+ else:
+ remotePackagesCsvURL = str(portageOutput.rstrip().split("=")[1].strip('\"').replace('packages', 'csv') + 'remotePackagesPre.csv')
+ remoteDescriptionsCsvURL = str(portageOutput.rstrip().split("=")[1].strip('\"').replace('packages', 'csv') + 'remoteDescriptionsPre.csv')
+ portageExec.wait()
return remotePackagesCsvURL,remoteDescriptionsCsvURL