From 103aa455aee322549c77aad205ce9e92dd7e6b52 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Sun, 30 Oct 2022 15:23:53 +0000 Subject: move updateAll -> update --- src/backend/__init__.py | 2 +- src/backend/installpkg.py | 4 +-- src/backend/installsrc.py | 4 +-- src/backend/searchpkg.py | 4 +-- src/backend/update.py | 55 ++++++++++++++++++++++++++++++++++++++++ src/backend/updateAll.py | 55 ---------------------------------------- src/backend/upgradePkg.py | 4 +-- src/backend/upgradeSrc.py | 4 +-- src/frontend/cli/sisyphus-cli.py | 2 +- src/frontend/gui/sisyphus-gui.py | 2 +- 10 files changed, 68 insertions(+), 68 deletions(-) create mode 100644 src/backend/update.py delete mode 100644 src/backend/updateAll.py diff --git a/src/backend/__init__.py b/src/backend/__init__.py index 371de60..dd96de9 100644 --- a/src/backend/__init__.py +++ b/src/backend/__init__.py @@ -19,6 +19,6 @@ from .syncenv import * from .syncspm import * from .sysinfo import * from .uninstall import * -from .updateAll import * +from .update import * from .upgradePkg import * from .upgradeSrc import * diff --git a/src/backend/installpkg.py b/src/backend/installpkg.py index 1a27051..0661831 100644 --- a/src/backend/installpkg.py +++ b/src/backend/installpkg.py @@ -13,11 +13,11 @@ import sisyphus.getfs import sisyphus.killemerge import sisyphus.solvedeps import sisyphus.syncdb -import sisyphus.updateAll +import sisyphus.update def cliExec(pkgname): if sisyphus.checkenv.root(): - sisyphus.updateAll.cliExec() + sisyphus.update.cliExec() binhostURL = sisyphus.getenv.binhostURL() areBinaries,areSources,needsConfig = sisyphus.solvedeps.package(pkgname) diff --git a/src/backend/installsrc.py b/src/backend/installsrc.py index 9b88974..374a215 100644 --- a/src/backend/installsrc.py +++ b/src/backend/installsrc.py @@ -11,11 +11,11 @@ import sisyphus.getenv import sisyphus.getfs import sisyphus.solvedeps import sisyphus.syncdb -import sisyphus.updateAll +import sisyphus.update def cliExec(pkgname): if sisyphus.checkenv.root(): - sisyphus.updateAll.cliExec() + sisyphus.update.cliExec() binhostURL = sisyphus.getenv.binhostURL() areBinaries,areSources,needsConfig = sisyphus.solvedeps.package(pkgname) diff --git a/src/backend/searchpkg.py b/src/backend/searchpkg.py index df62001..e0c33c6 100644 --- a/src/backend/searchpkg.py +++ b/src/backend/searchpkg.py @@ -3,7 +3,7 @@ import sqlite3 import sisyphus.checkenv import sisyphus.getfs -import sisyphus.updateAll +import sisyphus.update def searchDB(filter, cat = '', pn = '', desc = ''): NOVIRT = "AND cat NOT LIKE 'virtual'" @@ -126,7 +126,7 @@ def showSearch(filter, cat, pn, desc, single): def cliExec(filter, cat, pn, desc, single): if sisyphus.checkenv.root(): - sisyphus.updateAll.cliExec() + sisyphus.update.cliExec() else: print("\nYou are not root, cannot fetch updates.\nSearch result may be inaccurate!\n") diff --git a/src/backend/update.py b/src/backend/update.py new file mode 100644 index 0000000..5a6a6cd --- /dev/null +++ b/src/backend/update.py @@ -0,0 +1,55 @@ +#!/usr/bin/python3 + +import animation +import sys +import time +import sisyphus.checkenv +import sisyphus.getenv +import sisyphus.purgeenv +import sisyphus.syncdb +import sisyphus.syncenv + +def syncAll(): + sisyphus.purgeenv.cache() + sisyphus.syncenv.gentooRepo() + sisyphus.syncenv.redcoreRepo() + sisyphus.syncenv.portageConfigRepo() + sisyphus.syncdb.remoteTable() + +@animation.wait('fetching updates') +def cliExec(): + activeBranch = sisyphus.checkenv.branch() + binhostURL = sisyphus.getenv.binhostURL() + isSane = sisyphus.checkenv.sanity() + + if isSane == 1: + syncAll() + else: + if "packages-next" in binhostURL: + print("\nCurrent branch: '" + activeBranch + "' (stable)" + "\nCurrent binhost: '" + binhostURL + "' (testing)") + else: + print("\nCurrent branch: '" + activeBranch + "' (testing)" + "\nCurrent binhost: '" + binhostURL + "' (stable)") + sys.exit("\nInvalid branch - binhost pairing; Use 'sisyphus branch --help' for help; Quitting.") + +def guiExec(): + activeBranch = sisyphus.checkenv.branch() + binhostURL = sisyphus.getenv.binhostURL() + isSane = sisyphus.checkenv.sanity() + + if isSane == 1: + syncAll() + else: + if "packages-next" in binhostURL: + print("\nCurrent branch: '" + activeBranch + "' (stable)" + "\nCurrent binhost: '" + binhostURL + "' (testing)") + else: + print("\nCurrent branch: '" + activeBranch + "' (testing)" + "\nCurrent binhost: '" + binhostURL + "' (stable)") + print("\nInvalid branch - binhost pairing; Use 'sisyphus branch --help' for help; Quitting in 10 seconds.\n") + t = int(10) + while t: + mins, secs = divmod(t, 60) + timer = '{:02d}:{:02d}'.format(mins, secs) + print(timer, end="\r") + time.sleep(1) + t -= 1 + + sys.exit() diff --git a/src/backend/updateAll.py b/src/backend/updateAll.py deleted file mode 100644 index 5a6a6cd..0000000 --- a/src/backend/updateAll.py +++ /dev/null @@ -1,55 +0,0 @@ -#!/usr/bin/python3 - -import animation -import sys -import time -import sisyphus.checkenv -import sisyphus.getenv -import sisyphus.purgeenv -import sisyphus.syncdb -import sisyphus.syncenv - -def syncAll(): - sisyphus.purgeenv.cache() - sisyphus.syncenv.gentooRepo() - sisyphus.syncenv.redcoreRepo() - sisyphus.syncenv.portageConfigRepo() - sisyphus.syncdb.remoteTable() - -@animation.wait('fetching updates') -def cliExec(): - activeBranch = sisyphus.checkenv.branch() - binhostURL = sisyphus.getenv.binhostURL() - isSane = sisyphus.checkenv.sanity() - - if isSane == 1: - syncAll() - else: - if "packages-next" in binhostURL: - print("\nCurrent branch: '" + activeBranch + "' (stable)" + "\nCurrent binhost: '" + binhostURL + "' (testing)") - else: - print("\nCurrent branch: '" + activeBranch + "' (testing)" + "\nCurrent binhost: '" + binhostURL + "' (stable)") - sys.exit("\nInvalid branch - binhost pairing; Use 'sisyphus branch --help' for help; Quitting.") - -def guiExec(): - activeBranch = sisyphus.checkenv.branch() - binhostURL = sisyphus.getenv.binhostURL() - isSane = sisyphus.checkenv.sanity() - - if isSane == 1: - syncAll() - else: - if "packages-next" in binhostURL: - print("\nCurrent branch: '" + activeBranch + "' (stable)" + "\nCurrent binhost: '" + binhostURL + "' (testing)") - else: - print("\nCurrent branch: '" + activeBranch + "' (testing)" + "\nCurrent binhost: '" + binhostURL + "' (stable)") - print("\nInvalid branch - binhost pairing; Use 'sisyphus branch --help' for help; Quitting in 10 seconds.\n") - t = int(10) - while t: - mins, secs = divmod(t, 60) - timer = '{:02d}:{:02d}'.format(mins, secs) - print(timer, end="\r") - time.sleep(1) - t -= 1 - - sys.exit() diff --git a/src/backend/upgradePkg.py b/src/backend/upgradePkg.py index eea69a9..b4db8f5 100644 --- a/src/backend/upgradePkg.py +++ b/src/backend/upgradePkg.py @@ -13,11 +13,11 @@ import sisyphus.getfs import sisyphus.killemerge import sisyphus.solvedeps import sisyphus.syncdb -import sisyphus.updateAll +import sisyphus.update def cliExec(): if sisyphus.checkenv.root(): - sisyphus.updateAll.cliExec() + sisyphus.update.cliExec() binhostURL = sisyphus.getenv.binhostURL() areBinaries,areSources,needsConfig = sisyphus.solvedeps.world() diff --git a/src/backend/upgradeSrc.py b/src/backend/upgradeSrc.py index 481fd83..0ad66c8 100644 --- a/src/backend/upgradeSrc.py +++ b/src/backend/upgradeSrc.py @@ -11,11 +11,11 @@ import sisyphus.getenv import sisyphus.getfs import sisyphus.solvedeps import sisyphus.syncdb -import sisyphus.updateAll +import sisyphus.update def cliExec(): if sisyphus.checkenv.root(): - sisyphus.updateAll.cliExec() + sisyphus.update.cliExec() binhostURL = sisyphus.getenv.binhostURL() areBinaries,areSources,needsConfig = sisyphus.solvedeps.world() diff --git a/src/frontend/cli/sisyphus-cli.py b/src/frontend/cli/sisyphus-cli.py index c97dd3b..18b4c0b 100755 --- a/src/frontend/cli/sisyphus-cli.py +++ b/src/frontend/cli/sisyphus-cli.py @@ -178,7 +178,7 @@ def autoremove(): def update(): """Update the Portage tree, the Redcore Overlay(s), Portage configs and Sisyphus's package database.""" if sisyphus.checkenv.root(): - sisyphus.updateAll.cliExec() + sisyphus.update.cliExec() else: sys.exit("\nYou need root permissions to do this, exiting!\n") diff --git a/src/frontend/gui/sisyphus-gui.py b/src/frontend/gui/sisyphus-gui.py index e33c3be..9ce1436 100644 --- a/src/frontend/gui/sisyphus-gui.py +++ b/src/frontend/gui/sisyphus-gui.py @@ -391,7 +391,7 @@ class MainWorker(QtCore.QObject): def startUpdate(self): self.started.emit() sisyphus.setjobs.cliExec() - sisyphus.updateAll.guiExec() + sisyphus.update.guiExec() self.finished.emit() @QtCore.pyqtSlot() -- cgit v1.2.3