summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2022-09-17 21:28:17 +0100
committerV3n3RiX <venerix@koprulu.sector>2022-09-17 21:28:17 +0100
commit521cd9b1c25d88162f377bb05c8aadb70df028d7 (patch)
tree0f36169bd921303c2859d346235749b332379a2a
parentfb5e03d66502482c3e6b4b04d92a46898403e98c (diff)
move subprocess.Popen.communicate at the end of the data stream
-rw-r--r--src/backend/autoRemoveAll.py2
-rw-r--r--src/backend/getBinhost.py2
-rw-r--r--src/backend/installPkg.py4
-rw-r--r--src/backend/installSrc.py8
-rw-r--r--src/backend/resolveDeps.py4
-rw-r--r--src/backend/uninstallAll.py2
-rw-r--r--src/backend/upgradePkg.py4
-rw-r--r--src/backend/upgradeSrc.py6
8 files changed, 16 insertions, 16 deletions
diff --git a/src/backend/autoRemoveAll.py b/src/backend/autoRemoveAll.py
index 8b47dda..27d892d 100644
--- a/src/backend/autoRemoveAll.py
+++ b/src/backend/autoRemoveAll.py
@@ -18,11 +18,11 @@ def start():
def startqt():
portageExec = subprocess.Popen(['emerge', '--depclean'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
- stdout, stderr = portageExec.communicate()
# kill portage if the program dies or it's terminated by the user
atexit.register(sisyphus.killPortage.start, portageExec)
for portageOutput in io.TextIOWrapper(portageExec.stdout, encoding="utf-8"):
print(portageOutput.rstrip())
+ stdout, stderr = portageExec.communicate()
sisyphus.syncDatabase.syncLocal()
diff --git a/src/backend/getBinhost.py b/src/backend/getBinhost.py
index 3de4fca..faff197 100644
--- a/src/backend/getBinhost.py
+++ b/src/backend/getBinhost.py
@@ -6,10 +6,10 @@ import subprocess
def start():
isBinhost = []
portageExec = subprocess.Popen(['emerge', '--info', '--verbose'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
- stdout, stderr = portageExec.communicate()
for portageOutput in io.TextIOWrapper(portageExec.stdout, encoding="utf-8"):
if "PORTAGE_BINHOST" in portageOutput.rstrip():
isBinhost = str(portageOutput.rstrip().split("=")[1].strip('\"'))
+ stdout, stderr = portageExec.communicate()
return isBinhost
diff --git a/src/backend/installPkg.py b/src/backend/installPkg.py
index b1aaa11..a4d71c9 100644
--- a/src/backend/installPkg.py
+++ b/src/backend/installPkg.py
@@ -43,13 +43,13 @@ def start(pkgname):
os.remove(binary.rstrip().split("/")[1])
portageExec = subprocess.Popen(['emerge', '--usepkg', '--usepkgonly', '--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 io.TextIOWrapper(portageExec.stdout, encoding="utf-8"):
if not "These are the packages that would be merged, in order:" in portageOutput.rstrip():
if not "Calculating dependencies" in portageOutput.rstrip():
print(portageOutput.rstrip())
+ stdout, stderr = portageExec.communicate()
sisyphus.syncDatabase.syncLocal()
else:
sys.exit("\n" + "Ok; Quitting." + "\n")
@@ -84,7 +84,6 @@ def startqt(pkgname):
os.remove(binary.rstrip().split("/")[1])
portageExec = subprocess.Popen(['emerge', '--usepkg', '--usepkgonly', '--rebuilt-binaries', '--with-bdeps=y', '--misspell-suggestion=n', '--fuzzy-search=n'] + pkgname, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
- stdout, stderr = portageExec.communicate()
# kill portage if the program dies or it's terminated by the user
atexit.register(sisyphus.killPortage.start, portageExec)
@@ -93,4 +92,5 @@ def startqt(pkgname):
if not "Calculating dependencies" in portageOutput.rstrip():
print(portageOutput.rstrip())
+ stdout, stderr = portageExec.communicate()
sisyphus.syncDatabase.syncLocal()
diff --git a/src/backend/installSrc.py b/src/backend/installSrc.py
index aa32bd9..9fc7eec 100644
--- a/src/backend/installSrc.py
+++ b/src/backend/installSrc.py
@@ -41,13 +41,13 @@ def start(pkgname):
os.remove(binary.rstrip().split("/")[1])
portageExec = subprocess.Popen(['emerge', '--usepkg', '--usepkgonly', '--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 io.TextIOWrapper(portageExec.stdout, encoding="utf-8"):
if not "These are the packages that would be merged, in order:" in portageOutput.rstrip():
if not "Calculating dependencies" in portageOutput.rstrip():
print(portageOutput.rstrip())
+ stdout, stderr = portageExec.communicate()
sisyphus.syncDatabase.syncLocal()
else:
sys.exit("\n" + "Ok; Quitting." + "\n")
@@ -74,13 +74,13 @@ def start(pkgname):
os.remove(binary.rstrip().split("/")[1])
portageExec = subprocess.Popen(['emerge', '--usepkg', '--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 io.TextIOWrapper(portageExec.stdout, encoding="utf-8"):
if not "These are the packages that would be merged, in order:" in portageOutput.rstrip():
if not "Calculating dependencies" in portageOutput.rstrip():
print(portageOutput.rstrip())
+ stdout, stderr = portageExec.communicate()
sisyphus.syncDatabase.syncLocal()
else:
sys.exit("\n" + "Ok; Quitting." + "\n")
@@ -88,19 +88,18 @@ def start(pkgname):
print("\n" + "These are the source packages that would be merged, in order:" + "\n\n" + " ".join(areSources) + "\n\n" + "Total:" + " " + str(len(areSources)) + " " + "source package(s)" + "\n")
if input("Would you like to proceed?" + " " + "[y/N]" + " ").lower().strip()[:1] == "y":
portageExec = subprocess.Popen(['emerge', '--with-bdeps=y', '--misspell-suggestion=n', '--fuzzy-search=n'] + list(pkgname), stdout=subprocess.PIPE, stderr=subprocess.PIPE)
- stdout, stderr = portageExec.communicate()
for portageOutput in io.TextIOWrapper(portageExec.stdout, encoding="utf-8"):
if not "These are the packages that would be merged, in order:" in portageOutput.rstrip():
if not "Calculating dependencies" in portageOutput.rstrip():
print(portageOutput.rstrip())
+ stdout, stderr = portageExec.communicate()
sisyphus.syncDatabase.syncLocal()
else:
sys.exit("\n" + "Ok; Quitting." + "\n")
else:
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 io.TextIOWrapper(portageExec.stdout, encoding="utf-8"):
if not "Local copy of remote index is up-to-date and will be used." in portageOutput.rstrip():
@@ -108,6 +107,7 @@ def start(pkgname):
if not "binary" in portageOutput.rstrip():
print(portageOutput.rstrip())
+ stdout, stderr = portageExec.communicate()
sys.exit("\n" + "Cannot proceed; Apply the above changes to your portage configuration files and try again; Quitting." + "\n")
else:
sys.exit("\nYou need root permissions to do this, exiting!\n")
diff --git a/src/backend/resolveDeps.py b/src/backend/resolveDeps.py
index f0af4c0..580bfd4 100644
--- a/src/backend/resolveDeps.py
+++ b/src/backend/resolveDeps.py
@@ -10,7 +10,6 @@ def package(pkgname):
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 io.TextIOWrapper(portageExec.stderr, encoding="utf-8"):
if "The following keyword changes are necessary to proceed:" in portageOutput.rstrip():
@@ -34,6 +33,7 @@ def package(pkgname):
isSource = str(portageOutput.rstrip().split("]")[1].split("[")[0].strip("\ "))
areSources.append(isSource)
+ stdout, stderr = portageExec.communicate()
return areBinaries,areSources,needsConfig
@animation.wait('resolving dependencies')
@@ -42,7 +42,6 @@ def world():
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 io.TextIOWrapper(portageExec.stderr, encoding="utf-8"):
if "The following keyword changes are necessary to proceed:" in portageOutput.rstrip():
@@ -66,4 +65,5 @@ def world():
isSource = str(portageOutput.rstrip().split("]")[1].split("[")[0].strip("\ "))
areSources.append(isSource)
+ stdout, stderr = portageExec.communicate()
return areBinaries,areSources,needsConfig
diff --git a/src/backend/uninstallAll.py b/src/backend/uninstallAll.py
index c2dfdb6..ca985b3 100644
--- a/src/backend/uninstallAll.py
+++ b/src/backend/uninstallAll.py
@@ -18,11 +18,11 @@ def start(pkgname):
def startqt(pkgname):
portageExec = subprocess.Popen(['emerge', '--depclean'] + pkgname, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
- stdout, stderr = portageExec.communicate()
# kill portage if the program dies or it's terminated by the user
atexit.register(sisyphus.killPortage.start, portageExec)
for portageOutput in io.TextIOWrapper(portageExec.stdout, encoding="utf-8"):
print(portageOutput.rstrip())
+ stdout, stderr = portageExec.communicate()
sisyphus.syncDatabase.syncLocal()
diff --git a/src/backend/upgradePkg.py b/src/backend/upgradePkg.py
index 78f9025..59b4572 100644
--- a/src/backend/upgradePkg.py
+++ b/src/backend/upgradePkg.py
@@ -43,13 +43,13 @@ def start():
os.remove(binary.rstrip().split("/")[1])
portageExec = subprocess.Popen(['emerge', '--update', '--deep', '--newuse', '--usepkg', '--usepkgonly', '--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 io.TextIOWrapper(portageExec.stdout, encoding="utf-8"):
if not "These are the packages that would be merged, in order:" in portageOutput.rstrip():
if not "Calculating dependencies" in portageOutput.rstrip():
print(portageOutput.rstrip())
+ stdout, stderr = portageExec.communicate()
sisyphus.syncDatabase.syncLocal()
else:
sys.exit("\n" + "Ok; Quitting." + "\n")
@@ -88,7 +88,6 @@ def startqt():
os.remove(binary.rstrip().split("/")[1])
portageExec = subprocess.Popen(['emerge', '--update', '--deep', '--newuse', '--usepkg', '--usepkgonly', '--rebuilt-binaries', '--backtrack=100', '--with-bdeps=y', '--misspell-suggestion=n', '--fuzzy-search=n', '@world'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
- stdout, stderr = portageExec.communicate()
# kill portage if the program dies or it's terminated by the user
atexit.register(sisyphus.killPortage.start, portageExec)
@@ -97,6 +96,7 @@ def startqt():
if not "Calculating dependencies" in portageOutput.rstrip():
print(portageOutput.rstrip())
+ stdout, stderr = portageExec.communicate()
sisyphus.syncDatabase.syncLocal()
else:
print("\n" + "No package upgrades found; Quitting." + "\n")
diff --git a/src/backend/upgradeSrc.py b/src/backend/upgradeSrc.py
index 23782b2..728b88c 100644
--- a/src/backend/upgradeSrc.py
+++ b/src/backend/upgradeSrc.py
@@ -41,13 +41,13 @@ def start():
os.remove(binary.rstrip().split("/")[1])
portageExec = subprocess.Popen(['emerge', '--update', '--deep', '--newuse', '--usepkg', '--usepkgonly', '--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 io.TextIOWrapper(portageExec.stdout, encoding="utf-8"):
if not "These are the packages that would be merged, in order:" in portageOutput.rstrip():
if not "Calculating dependencies" in portageOutput.rstrip():
print(portageOutput.rstrip())
+ stdout, stderr = portageExec.communicate()
sisyphus.syncDatabase.syncLocal()
else:
sys.exit("\n" + "Ok; Quitting." + "\n")
@@ -74,7 +74,6 @@ def start():
os.remove(binary.rstrip().split("/")[1])
portageExec = subprocess.Popen(['emerge', '--update', '--deep', '--newuse', '--usepkg', '--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 io.TextIOWrapper(portageExec.stdout, encoding="utf-8"):
if not "These are the packages that would be merged, in order:" in portageOutput.rstrip():
@@ -95,12 +94,12 @@ def start():
if not "Calculating dependencies" in portageOutput.rstrip():
print(portageOutput.rstrip())
+ stdout, stderr = portageExec.communicate()
sisyphus.syncDatabase.syncLocal()
else:
sys.exit("\n" + "Ok; Quitting." + "\n")
else:
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 io.TextIOWrapper(portageExec.stdout, encoding="utf-8"):
if not "Local copy of remote index is up-to-date and will be used." in portageOutput.rstrip():
@@ -108,6 +107,7 @@ def start():
if not "binary" in portageOutput.rstrip():
print(portageOutput.rstrip())
+ stdout, stderr = portageExec.communicate()
sys.exit("\n" + "Cannot proceed; Apply the above changes to your portage configuration files and try again; Quitting." + "\n")
else:
sys.exit("\nYou need root permissions to do this, exiting!\n")