diff options
Diffstat (limited to 'src/backend')
-rw-r--r-- | src/backend/libsisyphus.py | 392 |
1 files changed, 208 insertions, 184 deletions
diff --git a/src/backend/libsisyphus.py b/src/backend/libsisyphus.py index 1fd9eab..0de7f95 100644 --- a/src/backend/libsisyphus.py +++ b/src/backend/libsisyphus.py @@ -224,7 +224,7 @@ def startInstall(pkgList): syncAll() binhostURL = getBinhostURL() - areBinaries,areSources = getPackageDeps(pkgList) + areBinaries,areSources,needsConfig = getPackageDeps(pkgList) binaryPkgs = [] if len(areSources) == 0: @@ -275,110 +275,122 @@ def startHybridInstall(pkgList): syncAll() binhostURL = getBinhostURL() - areBinaries,areSources = getPackageDeps(pkgList) + areBinaries,areSources,needsConfig = getPackageDeps(pkgList) binaryPkgs = [] - if len(areSources) == 0: - if not len(areBinaries) == 0: - os.chdir(portageCache) - print("\n" + "These are the binary packages that would be merged, in order:" + "\n\n" + str(areBinaries) + "\n\n" + "Total:" + " " + str(len(areBinaries)) + " " + "binary package(s)" + "\n") - if input("Would you like to proceed?" + " " + "[y/N]" + " ").lower().strip()[:1] == "y": - for index, url in enumerate([binhostURL + package + '.tbz2' for package in areBinaries]): - print(">>> Fetching" + " " + url) - wget.download(url) - print("\n") - - for index, binpkg in enumerate(areBinaries): - binaryPkg = str(binpkg.rstrip().split("/")[1]) - binaryPkgs.append(binaryPkg) - - for index, binpkg in enumerate(binaryPkgs): - subprocess.call(['qtbz2', '-x'] + str(binpkg + '.tbz2').split()) - CATEGORY = subprocess.check_output(['qxpak', '-x', '-O'] + str(binpkg + '.xpak').split() + ['CATEGORY']) - os.remove(str(binpkg + '.xpak')) - - if os.path.isdir(portageCache + CATEGORY.decode().strip()): - shutil.move(str(binpkg + '.tbz2'), os.path.join(portageCache + CATEGORY.decode().strip(), os.path.basename(str(binpkg + '.tbz2')))) - else: - os.makedirs(portageCache + CATEGORY.decode().strip()) - shutil.move(str(binpkg + '.tbz2'), os.path.join(portageCache + CATEGORY.decode().strip(), os.path.basename(str(binpkg + '.tbz2')))) - - if os.path.exists(str(binpkg + '.tbz2')): - os.remove(str(binpkg + '.tbz2')) - - portageExec = subprocess.Popen(['emerge', '--usepkg', '--usepkgonly', '--rebuilt-binaries', '--misspell-suggestion=n', '--fuzzy-search=n'] + pkgList, stdout=subprocess.PIPE) - - 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()) - - portageExec.wait() - syncLocalDatabase() + if needsConfig == 0: + if len(areSources) == 0: + if not len(areBinaries) == 0: + os.chdir(portageCache) + print("\n" + "These are the binary packages that would be merged, in order:" + "\n\n" + str(areBinaries) + "\n\n" + "Total:" + " " + str(len(areBinaries)) + " " + "binary package(s)" + "\n") + if input("Would you like to proceed?" + " " + "[y/N]" + " ").lower().strip()[:1] == "y": + for index, url in enumerate([binhostURL + package + '.tbz2' for package in areBinaries]): + print(">>> Fetching" + " " + url) + wget.download(url) + print("\n") + + for index, binpkg in enumerate(areBinaries): + binaryPkg = str(binpkg.rstrip().split("/")[1]) + binaryPkgs.append(binaryPkg) + + for index, binpkg in enumerate(binaryPkgs): + subprocess.call(['qtbz2', '-x'] + str(binpkg + '.tbz2').split()) + CATEGORY = subprocess.check_output(['qxpak', '-x', '-O'] + str(binpkg + '.xpak').split() + ['CATEGORY']) + os.remove(str(binpkg + '.xpak')) + + if os.path.isdir(portageCache + CATEGORY.decode().strip()): + shutil.move(str(binpkg + '.tbz2'), os.path.join(portageCache + CATEGORY.decode().strip(), os.path.basename(str(binpkg + '.tbz2')))) + else: + os.makedirs(portageCache + CATEGORY.decode().strip()) + shutil.move(str(binpkg + '.tbz2'), os.path.join(portageCache + CATEGORY.decode().strip(), os.path.basename(str(binpkg + '.tbz2')))) + + if os.path.exists(str(binpkg + '.tbz2')): + os.remove(str(binpkg + '.tbz2')) + + portageExec = subprocess.Popen(['emerge', '--usepkg', '--usepkgonly', '--rebuilt-binaries', '--misspell-suggestion=n', '--fuzzy-search=n'] + pkgList, stdout=subprocess.PIPE) + + 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()) + + portageExec.wait() + syncLocalDatabase() + else: + sys.exit("\n" + "Ok; Quitting." + "\n") else: - sys.exit("\n" + "Ok; Quitting." + "\n") + sys.exit("\n" + "No package found; Quitting." + "\n") else: - sys.exit("\n" + "No package found; Quitting." + "\n") - else: - if not len(areBinaries) == 0: - os.chdir(portageCache) - print("\n" + "These are the binary packages that would be merged, in order:" + "\n\n" + str(areBinaries) + "\n\n" + "Total:" + " " + str(len(areBinaries)) + " " + "binary package(s)" + "\n") - print("\n" + "These are the source packages that would be merged, in order:" + "\n\n" + str(areSources) + "\n\n" + "Total:" + " " + str(len(areSources)) + " " + "source package(s)" + "\n") - if input("Would you like to proceed?" + " " + "[y/N]" + " ").lower().strip()[:1] == "y": - for index, url in enumerate([binhostURL + package + '.tbz2' for package in areBinaries]): - print(">>> Fetching" + " " + url) - wget.download(url) - print("\n") - - for index, binpkg in enumerate(areBinaries): - binaryPkg = str(binpkg.rstrip().split("/")[1]) - binaryPkgs.append(binaryPkg) - - for index, binpkg in enumerate(binaryPkgs): - subprocess.call(['qtbz2', '-x'] + str(binpkg + '.tbz2').split()) - CATEGORY = subprocess.check_output(['qxpak', '-x', '-O'] + str(binpkg + '.xpak').split() + ['CATEGORY']) - os.remove(str(binpkg + '.xpak')) - - if os.path.isdir(portageCache + CATEGORY.decode().strip()): - shutil.move(str(binpkg + '.tbz2'), os.path.join(portageCache + CATEGORY.decode().strip(), os.path.basename(str(binpkg + '.tbz2')))) - else: - os.makedirs(portageCache + CATEGORY.decode().strip()) - shutil.move(str(binpkg + '.tbz2'), os.path.join(portageCache + CATEGORY.decode().strip(), os.path.basename(str(binpkg + '.tbz2')))) - - if os.path.exists(str(binpkg + '.tbz2')): - os.remove(str(binpkg + '.tbz2')) - - portageExec = subprocess.Popen(['emerge', '--usepkg', '--rebuilt-binaries', '--misspell-suggestion=n', '--fuzzy-search=n'] + pkgList, stdout=subprocess.PIPE) - - 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()) - - portageExec.wait() - syncLocalDatabase() + if not len(areBinaries) == 0: + os.chdir(portageCache) + print("\n" + "These are the binary packages that would be merged, in order:" + "\n\n" + str(areBinaries) + "\n\n" + "Total:" + " " + str(len(areBinaries)) + " " + "binary package(s)" + "\n") + print("\n" + "These are the source packages that would be merged, in order:" + "\n\n" + str(areSources) + "\n\n" + "Total:" + " " + str(len(areSources)) + " " + "source package(s)" + "\n") + if input("Would you like to proceed?" + " " + "[y/N]" + " ").lower().strip()[:1] == "y": + for index, url in enumerate([binhostURL + package + '.tbz2' for package in areBinaries]): + print(">>> Fetching" + " " + url) + wget.download(url) + print("\n") + + for index, binpkg in enumerate(areBinaries): + binaryPkg = str(binpkg.rstrip().split("/")[1]) + binaryPkgs.append(binaryPkg) + + for index, binpkg in enumerate(binaryPkgs): + subprocess.call(['qtbz2', '-x'] + str(binpkg + '.tbz2').split()) + CATEGORY = subprocess.check_output(['qxpak', '-x', '-O'] + str(binpkg + '.xpak').split() + ['CATEGORY']) + os.remove(str(binpkg + '.xpak')) + + if os.path.isdir(portageCache + CATEGORY.decode().strip()): + shutil.move(str(binpkg + '.tbz2'), os.path.join(portageCache + CATEGORY.decode().strip(), os.path.basename(str(binpkg + '.tbz2')))) + else: + os.makedirs(portageCache + CATEGORY.decode().strip()) + shutil.move(str(binpkg + '.tbz2'), os.path.join(portageCache + CATEGORY.decode().strip(), os.path.basename(str(binpkg + '.tbz2')))) + + if os.path.exists(str(binpkg + '.tbz2')): + os.remove(str(binpkg + '.tbz2')) + + portageExec = subprocess.Popen(['emerge', '--usepkg', '--rebuilt-binaries', '--misspell-suggestion=n', '--fuzzy-search=n'] + pkgList, stdout=subprocess.PIPE) + + 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()) + + portageExec.wait() + syncLocalDatabase() + else: + sys.exit("\n" + "Ok; Quitting." + "\n") else: - sys.exit("\n" + "Ok; Quitting." + "\n") - else: - print("\n" + "These are the source packages that would be merged, in order:" + "\n\n" + str(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', '--misspell-suggestion=n', '--fuzzy-search=n'] + pkgList, stdout=subprocess.PIPE) + print("\n" + "These are the source packages that would be merged, in order:" + "\n\n" + str(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', '--misspell-suggestion=n', '--fuzzy-search=n'] + pkgList, stdout=subprocess.PIPE) + + 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()) + + portageExec.wait() + syncLocalDatabase() + else: + sys.exit("\n" + "Ok; Quitting." + "\n") + else: + 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 not "These are the packages that would be merged, in order:" in portageOutput.rstrip(): - if not "Calculating dependencies" in portageOutput.rstrip(): - print(portageOutput.rstrip()) + 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(): + if not "ebuild" in portageOutput.rstrip(): + if not "binary" in portageOutput.rstrip(): + print(portageOutput.rstrip()) - portageExec.wait() - syncLocalDatabase() - else: - sys.exit("\n" + "Ok; Quitting." + "\n") + portageExec.wait() + sys.exit("\n" + "Cannot proceed; Apply the above changes to your portage configuration files and try again; Quitting." + "\n") def startUpgrade(): syncAll() binhostURL = getBinhostURL() - areBinaries,areSources = getWorldDeps() + areBinaries,areSources,needsConfig = getWorldDeps() binaryPkgs = [] if len(areSources) == 0: @@ -429,104 +441,116 @@ def startHybridUpgrade(): syncAll() binhostURL = getBinhostURL() - areBinaries,areSources = getWorldDeps() + areBinaries,areSources,needsConfig = getWorldDeps() binaryPkgs = [] - if len(areSources) == 0: - if not len(areBinaries) == 0: - os.chdir(portageCache) - print("\n" + "These are the binary packages that would be merged, in order:" + "\n\n" + str(areBinaries) + "\n\n" + "Total:" + " " + str(len(areBinaries)) + " " + "binary package(s)" + "\n") - if input("Would you like to proceed?" + " " + "[y/N]" + " ").lower().strip()[:1] == "y": - for index, url in enumerate([binhostURL + package + '.tbz2' for package in areBinaries]): - print(">>> Fetching" + " " + url) - wget.download(url) - print("\n") - - for index, binpkg in enumerate(areBinaries): - binaryPkg = str(binpkg.rstrip().split("/")[1]) - binaryPkgs.append(binaryPkg) - - for index, binpkg in enumerate(binaryPkgs): - subprocess.call(['qtbz2', '-x'] + str(binpkg + '.tbz2').split()) - CATEGORY = subprocess.check_output(['qxpak', '-x', '-O'] + str(binpkg + '.xpak').split() + ['CATEGORY']) - os.remove(str(binpkg + '.xpak')) - - if os.path.isdir(portageCache + CATEGORY.decode().strip()): - shutil.move(str(binpkg + '.tbz2'), os.path.join(portageCache + CATEGORY.decode().strip(), os.path.basename(str(binpkg + '.tbz2')))) - else: - os.makedirs(portageCache + CATEGORY.decode().strip()) - shutil.move(str(binpkg + '.tbz2'), os.path.join(portageCache + CATEGORY.decode().strip(), os.path.basename(str(binpkg + '.tbz2')))) - - if os.path.exists(str(binpkg + '.tbz2')): - os.remove(str(binpkg + '.tbz2')) - - 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) - - 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()) - - portageExec.wait() - syncLocalDatabase() + if needsConfig == 0: + if len(areSources) == 0: + if not len(areBinaries) == 0: + os.chdir(portageCache) + print("\n" + "These are the binary packages that would be merged, in order:" + "\n\n" + str(areBinaries) + "\n\n" + "Total:" + " " + str(len(areBinaries)) + " " + "binary package(s)" + "\n") + if input("Would you like to proceed?" + " " + "[y/N]" + " ").lower().strip()[:1] == "y": + for index, url in enumerate([binhostURL + package + '.tbz2' for package in areBinaries]): + print(">>> Fetching" + " " + url) + wget.download(url) + print("\n") + + for index, binpkg in enumerate(areBinaries): + binaryPkg = str(binpkg.rstrip().split("/")[1]) + binaryPkgs.append(binaryPkg) + + for index, binpkg in enumerate(binaryPkgs): + subprocess.call(['qtbz2', '-x'] + str(binpkg + '.tbz2').split()) + CATEGORY = subprocess.check_output(['qxpak', '-x', '-O'] + str(binpkg + '.xpak').split() + ['CATEGORY']) + os.remove(str(binpkg + '.xpak')) + + if os.path.isdir(portageCache + CATEGORY.decode().strip()): + shutil.move(str(binpkg + '.tbz2'), os.path.join(portageCache + CATEGORY.decode().strip(), os.path.basename(str(binpkg + '.tbz2')))) + else: + os.makedirs(portageCache + CATEGORY.decode().strip()) + shutil.move(str(binpkg + '.tbz2'), os.path.join(portageCache + CATEGORY.decode().strip(), os.path.basename(str(binpkg + '.tbz2')))) + + if os.path.exists(str(binpkg + '.tbz2')): + os.remove(str(binpkg + '.tbz2')) + + 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) + + 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()) + + portageExec.wait() + syncLocalDatabase() + else: + sys.exit("\n" + "Ok; Quitting." + "\n") else: - sys.exit("\n" + "Ok; Quitting." + "\n") + sys.exit("\n" + "No package upgrades found; Quitting." + "\n") else: - sys.exit("\n" + "No package upgrades found; Quitting." + "\n") - else: - if not len(areBinaries) == 0: - os.chdir(portageCache) - print("\n" + "These are the binary packages that would be merged, in order:" + "\n\n" + str(areBinaries) + "\n\n" + "Total:" + " " + str(len(areBinaries)) + " " + "binary package(s)" + "\n") - print("\n" + "These are the source packages that would be merged, in order:" + "\n\n" + str(areSources) + "\n\n" + "Total:" + " " + str(len(areSources)) + " " + "source package(s)" + "\n") - if input("Would you like to proceed?" + " " + "[y/N]" + " ").lower().strip()[:1] == "y": - for index, url in enumerate([binhostURL + package + '.tbz2' for package in areBinaries]): - print(">>> Fetching" + " " + url) - wget.download(url) - print("\n") - - for index, binpkg in enumerate(areBinaries): - binaryPkg = str(binpkg.rstrip().split("/")[1]) - binaryPkgs.append(binaryPkg) - - for index, binpkg in enumerate(binaryPkgs): - subprocess.call(['qtbz2', '-x'] + str(binpkg + '.tbz2').split()) - CATEGORY = subprocess.check_output(['qxpak', '-x', '-O'] + str(binpkg + '.xpak').split() + ['CATEGORY']) - os.remove(str(binpkg + '.xpak')) - - if os.path.isdir(portageCache + CATEGORY.decode().strip()): - shutil.move(str(binpkg + '.tbz2'), os.path.join(portageCache + CATEGORY.decode().strip(), os.path.basename(str(binpkg + '.tbz2')))) - else: - os.makedirs(portageCache + CATEGORY.decode().strip()) - shutil.move(str(binpkg + '.tbz2'), os.path.join(portageCache + CATEGORY.decode().strip(), os.path.basename(str(binpkg + '.tbz2')))) - - if os.path.exists(str(binpkg + '.tbz2')): - os.remove(str(binpkg + '.tbz2')) - - 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) - - 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()) - - portageExec.wait() - syncLocalDatabase() + if not len(areBinaries) == 0: + os.chdir(portageCache) + print("\n" + "These are the binary packages that would be merged, in order:" + "\n\n" + str(areBinaries) + "\n\n" + "Total:" + " " + str(len(areBinaries)) + " " + "binary package(s)" + "\n") + print("\n" + "These are the source packages that would be merged, in order:" + "\n\n" + str(areSources) + "\n\n" + "Total:" + " " + str(len(areSources)) + " " + "source package(s)" + "\n") + if input("Would you like to proceed?" + " " + "[y/N]" + " ").lower().strip()[:1] == "y": + for index, url in enumerate([binhostURL + package + '.tbz2' for package in areBinaries]): + print(">>> Fetching" + " " + url) + wget.download(url) + print("\n") + + for index, binpkg in enumerate(areBinaries): + binaryPkg = str(binpkg.rstrip().split("/")[1]) + binaryPkgs.append(binaryPkg) + + for index, binpkg in enumerate(binaryPkgs): + subprocess.call(['qtbz2', '-x'] + str(binpkg + '.tbz2').split()) + CATEGORY = subprocess.check_output(['qxpak', '-x', '-O'] + str(binpkg + '.xpak').split() + ['CATEGORY']) + os.remove(str(binpkg + '.xpak')) + + if os.path.isdir(portageCache + CATEGORY.decode().strip()): + shutil.move(str(binpkg + '.tbz2'), os.path.join(portageCache + CATEGORY.decode().strip(), os.path.basename(str(binpkg + '.tbz2')))) + else: + os.makedirs(portageCache + CATEGORY.decode().strip()) + shutil.move(str(binpkg + '.tbz2'), os.path.join(portageCache + CATEGORY.decode().strip(), os.path.basename(str(binpkg + '.tbz2')))) + + if os.path.exists(str(binpkg + '.tbz2')): + os.remove(str(binpkg + '.tbz2')) + + 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) + + 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()) + + portageExec.wait() + syncLocalDatabase() + else: + sys.exit("\n" + "Ok; Quitting." + "\n") else: - sys.exit("\n" + "Ok; Quitting." + "\n") - else: - print("\n" + "These are the source packages that would be merged, in order:" + "\n\n" + str(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', '--update', '--deep', '--newuse', '--backtrack=100', '--with-bdeps=y', '--misspell-suggestion=n', '--fuzzy-search=n', '@world'], stdout=subprocess.PIPE) + print("\n" + "These are the source packages that would be merged, in order:" + "\n\n" + str(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', '--update', '--deep', '--newuse', '--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 not "These are the packages that would be merged, in order:" in portageOutput.rstrip(): + if not "Calculating dependencies" in portageOutput.rstrip(): + print(portageOutput.rstrip()) + + portageExec.wait() + syncLocalDatabase() + 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) - 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()) + 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(): + if not "ebuild" in portageOutput.rstrip(): + if not "binary" in portageOutput.rstrip(): + print(portageOutput.rstrip()) - portageExec.wait() - syncLocalDatabase() - else: - sys.exit("\n" + "Ok; Quitting." + "\n") + portageExec.wait() + sys.exit("\n" + "Cannot proceed; Apply the above changes to your portage configuration files and try again; Quitting." + "\n") def startUninstall(pkgList): portageExec = subprocess.Popen(['emerge', '--quiet', '--depclean', '--ask'] + pkgList) |