From a95594606729ac4c6bbbc06f05272db240cd10d0 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Sun, 11 Nov 2018 19:27:24 +0000 Subject: fix logic, and open up some further options for hybrid mode --- src/backend/libsisyphus.py | 152 ++++++++++++++++++++++----------------------- 1 file changed, 76 insertions(+), 76 deletions(-) diff --git a/src/backend/libsisyphus.py b/src/backend/libsisyphus.py index 41def55..64ffaaf 100644 --- a/src/backend/libsisyphus.py +++ b/src/backend/libsisyphus.py @@ -233,30 +233,30 @@ def startInstall(pkgList): print(">>> Fetching" + " " + url) wget.download(url) print("\n") - else: - sys.exit("\n" + "Quitting!") - for index, binpkg in enumerate(binaryDeps): - binaryPkg = str(binpkg.rstrip().split("/")[1]) - binaryPkgs.append(binaryPkg) + for index, binpkg in enumerate(binaryDeps): + 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')) + 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.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')) + if os.path.exists(str(binpkg + '.tbz2')): + os.remove(str(binpkg + '.tbz2')) - portageExec = subprocess.Popen(['emerge', '--quiet', '--usepkg', '--usepkgonly', '--rebuilt-binaries', '--misspell-suggestion=n', '--fuzzy-search=n'] + pkgList) - portageExec.wait() - syncLocalDatabase() + portageExec = subprocess.Popen(['emerge', '--quiet', '--usepkg', '--usepkgonly', '--rebuilt-binaries', '--misspell-suggestion=n', '--fuzzy-search=n'] + pkgList) + portageExec.wait() + syncLocalDatabase() + else: + sys.exit("\n" + "Ok; quitting.") else: sys.exit("\n" + "No such binary package; quitting." + "\n") @@ -277,30 +277,30 @@ def startHybridInstall(pkgList): print(">>> Fetching" + " " + url) wget.download(url) print("\n") - else: - sys.exit("\n" + "Quitting!") - for index, binpkg in enumerate(binaryDeps): - binaryPkg = str(binpkg.rstrip().split("/")[1]) - binaryPkgs.append(binaryPkg) + for index, binpkg in enumerate(binaryDeps): + 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')) + 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.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')) + if os.path.exists(str(binpkg + '.tbz2')): + os.remove(str(binpkg + '.tbz2')) - portageExec = subprocess.Popen(['emerge', '--quiet', '--usepkg', '--usepkgonly', '--rebuilt-binaries', '--misspell-suggestion=n', '--fuzzy-search=n'] + pkgList) - portageExec.wait() - syncLocalDatabase() + portageExec = subprocess.Popen(['emerge', '--quiet', '--usepkg', '--usepkgonly', '--rebuilt-binaries', '--misspell-suggestion=n', '--fuzzy-search=n'] + pkgList) + portageExec.wait() + syncLocalDatabase() + else: + sys.exit("\n" + "Ok; quitting.") else: sys.exit("\n" + "No such binary package; quitting." + "\n") else: @@ -321,30 +321,30 @@ def startUpgrade(): print(">>> Fetching" + " " + url) wget.download(url) print("\n") - else: - sys.exit("\n" + "Quitting!") - for index, worldpkg in enumerate(binaryDeps): - binaryPkg = str(worldpkg.rstrip().split("/")[1]) - binaryPkgs.append(binaryPkg) + for index, worldpkg in enumerate(binaryDeps): + binaryPkg = str(worldpkg.rstrip().split("/")[1]) + binaryPkgs.append(binaryPkg) - for index, worldpkg in enumerate(binaryPkgs): - subprocess.call(['qtbz2', '-x'] + str(worldpkg + '.tbz2').split()) - CATEGORY = subprocess.check_output(['qxpak', '-x', '-O'] + str(worldpkg + '.xpak').split() + ['CATEGORY']) - os.remove(str(worldpkg + '.xpak')) + for index, worldpkg in enumerate(binaryPkgs): + subprocess.call(['qtbz2', '-x'] + str(worldpkg + '.tbz2').split()) + CATEGORY = subprocess.check_output(['qxpak', '-x', '-O'] + str(worldpkg + '.xpak').split() + ['CATEGORY']) + os.remove(str(worldpkg + '.xpak')) - if os.path.isdir(portageCache + CATEGORY.decode().strip()): - shutil.move(str(worldpkg + '.tbz2'), os.path.join(portageCache + CATEGORY.decode().strip(), os.path.basename(str(worldpkg + '.tbz2')))) - else: - os.makedirs(portageCache + CATEGORY.decode().strip()) - shutil.move(str(worldpkg + '.tbz2'), os.path.join(portageCache + CATEGORY.decode().strip(), os.path.basename(str(worldpkg + '.tbz2')))) + if os.path.isdir(portageCache + CATEGORY.decode().strip()): + shutil.move(str(worldpkg + '.tbz2'), os.path.join(portageCache + CATEGORY.decode().strip(), os.path.basename(str(worldpkg + '.tbz2')))) + else: + os.makedirs(portageCache + CATEGORY.decode().strip()) + shutil.move(str(worldpkg + '.tbz2'), os.path.join(portageCache + CATEGORY.decode().strip(), os.path.basename(str(worldpkg + '.tbz2')))) - if os.path.exists(str(worldpkg + '.tbz2')): - os.remove(str(worldpkg + '.tbz2')) + if os.path.exists(str(worldpkg + '.tbz2')): + os.remove(str(worldpkg + '.tbz2')) - portageExec = subprocess.Popen(['emerge', '--quiet', '--update', '--deep', '--newuse', '--usepkg', '--usepkgonly', '--rebuilt-binaries', '--backtrack=100', '--with-bdeps=y', '--misspell-suggestion=n', '--fuzzy-search=n', '@world']) - portageExec.wait() - syncLocalDatabase() + portageExec = subprocess.Popen(['emerge', '--quiet', '--update', '--deep', '--newuse', '--usepkg', '--usepkgonly', '--rebuilt-binaries', '--backtrack=100', '--with-bdeps=y', '--misspell-suggestion=n', '--fuzzy-search=n', '@world']) + portageExec.wait() + syncLocalDatabase() + else: + sys.exit("\n" + "Ok; quitting.") else: sys.exit("\n" + "Nothing to upgrade; quitting." + "\n") @@ -365,30 +365,30 @@ def startHybridUpgrade(): print(">>> Fetching" + " " + url) wget.download(url) print("\n") - else: - sys.exit("\n" + "Quitting!") - for index, worldpkg in enumerate(binaryDeps): - binaryPkg = str(worldpkg.rstrip().split("/")[1]) - binaryPkgs.append(binaryPkg) + for index, worldpkg in enumerate(binaryDeps): + binaryPkg = str(worldpkg.rstrip().split("/")[1]) + binaryPkgs.append(binaryPkg) - for index, worldpkg in enumerate(binaryPkgs): - subprocess.call(['qtbz2', '-x'] + str(worldpkg + '.tbz2').split()) - CATEGORY = subprocess.check_output(['qxpak', '-x', '-O'] + str(worldpkg + '.xpak').split() + ['CATEGORY']) - os.remove(str(worldpkg + '.xpak')) + for index, worldpkg in enumerate(binaryPkgs): + subprocess.call(['qtbz2', '-x'] + str(worldpkg + '.tbz2').split()) + CATEGORY = subprocess.check_output(['qxpak', '-x', '-O'] + str(worldpkg + '.xpak').split() + ['CATEGORY']) + os.remove(str(worldpkg + '.xpak')) - if os.path.isdir(portageCache + CATEGORY.decode().strip()): - shutil.move(str(worldpkg + '.tbz2'), os.path.join(portageCache + CATEGORY.decode().strip(), os.path.basename(str(worldpkg + '.tbz2')))) - else: - os.makedirs(portageCache + CATEGORY.decode().strip()) - shutil.move(str(worldpkg + '.tbz2'), os.path.join(portageCache + CATEGORY.decode().strip(), os.path.basename(str(worldpkg + '.tbz2')))) + if os.path.isdir(portageCache + CATEGORY.decode().strip()): + shutil.move(str(worldpkg + '.tbz2'), os.path.join(portageCache + CATEGORY.decode().strip(), os.path.basename(str(worldpkg + '.tbz2')))) + else: + os.makedirs(portageCache + CATEGORY.decode().strip()) + shutil.move(str(worldpkg + '.tbz2'), os.path.join(portageCache + CATEGORY.decode().strip(), os.path.basename(str(worldpkg + '.tbz2')))) - if os.path.exists(str(worldpkg + '.tbz2')): - os.remove(str(worldpkg + '.tbz2')) + if os.path.exists(str(worldpkg + '.tbz2')): + os.remove(str(worldpkg + '.tbz2')) - portageExec = subprocess.Popen(['emerge', '--quiet', '--update', '--deep', '--newuse', '--usepkg', '--usepkgonly', '--rebuilt-binaries', '--backtrack=100', '--with-bdeps=y', '--misspell-suggestion=n', '--fuzzy-search=n', '@world']) - portageExec.wait() - syncLocalDatabase() + portageExec = subprocess.Popen(['emerge', '--quiet', '--update', '--deep', '--newuse', '--usepkg', '--usepkgonly', '--rebuilt-binaries', '--backtrack=100', '--with-bdeps=y', '--misspell-suggestion=n', '--fuzzy-search=n', '@world']) + portageExec.wait() + syncLocalDatabase() + else: + sys.exit("\n" + "Ok; quitting.") else: sys.exit("\n" + "Nothing to upgrade; quitting." + "\n") else: -- cgit v1.2.3