diff options
-rw-r--r-- | app-portage/sisyphus/Manifest | 1 | ||||
-rw-r--r-- | app-portage/sisyphus/files/sisyphus-0.1709-r1.patch | 371 | ||||
-rw-r--r-- | app-portage/sisyphus/sisyphus-0.1709-r1.ebuild (renamed from app-portage/sisyphus/sisyphus-0.1709.ebuild) | 14 |
3 files changed, 379 insertions, 7 deletions
diff --git a/app-portage/sisyphus/Manifest b/app-portage/sisyphus/Manifest new file mode 100644 index 00000000..75d0428a --- /dev/null +++ b/app-portage/sisyphus/Manifest @@ -0,0 +1 @@ +DIST sisyphus-0.1709.tar.gz 181405 SHA256 e6b3969a8cb699f1e98f42f7812672ed312ef10675a01ab9eb44d838fb8b05dc SHA512 c582992fead2eed6e0378ee6b348e30f33409c0bc956ab0805af106798cd2d500a13593a1e5c191196e3e65bb3d518e7c2fc154f6e52e5011bf891c0c69f82fa WHIRLPOOL 3f878f52b9a60ed0bcfdf1b15a8329efd10555c7bcb84b184fc76ed0b0c3da61c3c5a2321e5f6526e04e28228fba0373e97365ac0070bab880b0463d34c403db diff --git a/app-portage/sisyphus/files/sisyphus-0.1709-r1.patch b/app-portage/sisyphus/files/sisyphus-0.1709-r1.patch new file mode 100644 index 00000000..206b3cc7 --- /dev/null +++ b/app-portage/sisyphus/files/sisyphus-0.1709-r1.patch @@ -0,0 +1,371 @@ +diff --git a/src/backend/libsisyphus.py b/src/backend/libsisyphus.py +index 8516a3d..120e268 100755 +--- a/src/backend/libsisyphus.py ++++ b/src/backend/libsisyphus.py +@@ -1,16 +1,16 @@ + #!/usr/bin/python3 + ++import animation ++import atexit + import csv + import filecmp + import os + import shutil + import sqlite3 +-import sys +-import urllib3 + import subprocess +-import animation ++import sys + import time +-import atexit ++import urllib3 + + redcore_portage_tree_path = '/usr/portage' + redcore_desktop_overlay_path = '/var/lib/layman/redcore-desktop' +@@ -19,13 +19,14 @@ + sisyphus_remote_csv_url = 'http://mirror.math.princeton.edu/pub/redcorelinux/csv/remote_preinst.csv' + sisyphus_remote_csv_path_pre = '/var/lib/sisyphus/csv/remote_preinst.csv' + sisyphus_remote_csv_path_post = '/var/lib/sisyphus/csv/remote_postinst.csv' ++sisyphus_removeable_csv_url = 'http://mirror.math.princeton.edu/pub/redcorelinux/csv/removeable_preinst.csv' ++sisyphus_removeable_csv_path_pre = '/var/lib/sisyphus/csv/removeable_preinst.csv' ++sisyphus_removeable_csv_path_post = '/var/lib/sisyphus/csv/removeable_postinst.csv' + sisyphus_local_csv_path_pre = '/var/lib/sisyphus/csv/local_preinst.csv' + sisyphus_local_csv_path_post = '/var/lib/sisyphus/csv/local_postinst.csv' + sisyphus_spm_csv_path = '/var/lib/sisyphus/csv/spmsync.csv' + sisyphus_database_path = '/var/lib/sisyphus/db/sisyphus.db' + +-BLACKHOLE = open(os.devnull, 'w') +- + def check_if_root(): + if not os.getuid() == 0: + sys.exit("\nYou need root permissions to do this, exiting!\n") +@@ -47,36 +48,6 @@ def check_system_mode(): + print("\nThe system is not set to binmode or mixedmode, refusing to run!\n") + sys.exit(1) + +-def check_redcore_portage_tree(): +- os.chdir(redcore_portage_tree_path) +- subprocess.call(['git', 'remote', 'update'], stdout=BLACKHOLE, stderr=subprocess.STDOUT) +- redcore_portage_tree_local_hash = subprocess.check_output(['git', 'rev-parse', '@']) +- redcore_portage_tree_remote_hash = subprocess.check_output(['git', 'rev-parse', '@{u}']) +- +- if not redcore_portage_tree_local_hash == redcore_portage_tree_remote_hash: +- print("\nPortage tree is out-of-date, run 'sisyphus update' first!\n") +- sys.exit(1) +- +-def check_redcore_desktop_overlay(): +- os.chdir(redcore_desktop_overlay_path) +- subprocess.check_call(['git', 'remote', 'update'], stdout=BLACKHOLE, stderr=subprocess.STDOUT) +- redcore_desktop_overlay_local_hash = subprocess.check_output(['git', 'rev-parse', '@']) +- redcore_desktop_overlay_remote_hash = subprocess.check_output(['git', 'rev-parse', '@{u}']) +- +- if not redcore_desktop_overlay_local_hash == redcore_desktop_overlay_remote_hash: +- print("\nOverlay is out-of-date, run 'sisyphus update' first!\n") +- sys.exit(1) +- +-def check_redcore_portage_config(): +- os.chdir(redcore_portage_config_path) +- subprocess.check_call(['git', 'remote', 'update'], stdout=BLACKHOLE, stderr=subprocess.STDOUT) +- redcore_portage_config_local_hash = subprocess.check_output(['git', 'rev-parse', '@']) +- redcore_portage_config_remote_hash = subprocess.check_output(['git', 'rev-parse', '@{u}']) +- +- if not redcore_portage_config_local_hash == redcore_portage_config_remote_hash: +- print("\nPortage config is out-of-date, run 'sisyphus update' first!\n") +- sys.exit(1) +- + def fetch_sisyphus_remote_packages_table_csv(): + http = urllib3.PoolManager() + +@@ -88,35 +59,24 @@ def fetch_sisyphus_remote_packages_table_csv(): + with http.request('GET', sisyphus_remote_csv_url, preload_content=False) as tmp_buffer, open(sisyphus_remote_csv_path_post, 'wb') as output_file: + shutil.copyfileobj(tmp_buffer, output_file) + +-def check_sisyphus_remote_packages_table_csv(): +- if not filecmp.cmp(sisyphus_remote_csv_path_pre, sisyphus_remote_csv_path_post): +- print("\nSisyphus database is out-of-date, run 'sisyphus update' first!\n") +- os.remove(sisyphus_remote_csv_path_post) +- sys.exit(1) +- else: +- os.remove(sisyphus_remote_csv_path_post) +- +-def check_sisyphus_remote_packages_table(): +- fetch_sisyphus_remote_packages_table_csv() +- check_sisyphus_remote_packages_table_csv() ++def fetch_sisyphus_removeable_packages_table_csv(): ++ http = urllib3.PoolManager() + +-def check_sync(): +- check_if_root() +- check_redcore_portage_tree() +- check_redcore_desktop_overlay() +- check_redcore_portage_config() +- check_sisyphus_remote_packages_table() ++ if not os.path.isfile(sisyphus_removeable_csv_path_pre): ++ os.mknod(sisyphus_removeable_csv_path_pre) ++ with http.request('GET', sisyphus_removeable_csv_url, preload_content=False) as tmp_buffer, open(sisyphus_removeable_csv_path_post, 'wb') as output_file: ++ shutil.copyfileobj(tmp_buffer, output_file) ++ else: ++ with http.request('GET', sisyphus_removeable_csv_url, preload_content=False) as tmp_buffer, open(sisyphus_removeable_csv_path_post, 'wb') as output_file: ++ shutil.copyfileobj(tmp_buffer, output_file) + +-@animation.wait('fetching remote ebuilds') + def sync_redcore_portage_tree_and_desktop_overlay(): + subprocess.check_call(['emerge', '--sync', '--quiet']) + +-@animation.wait('fetching remote configs') + def sync_redcore_portage_config(): + os.chdir(redcore_portage_config_path) + subprocess.call(['git', 'pull', '--quiet']) + +-@animation.wait('fetching remote database') + def sync_sisyphus_remote_packages_table_csv(): + if not filecmp.cmp(sisyphus_remote_csv_path_pre, sisyphus_remote_csv_path_post): + sisyphusdb = sqlite3.connect(sisyphus_database_path) +@@ -128,16 +88,34 @@ def sync_sisyphus_remote_packages_table_csv(): + sisyphusdb.commit() + sisyphusdb.close() + shutil.move(sisyphus_remote_csv_path_post, sisyphus_remote_csv_path_pre) ++ ++def sync_sisyphus_removeable_packages_table_csv(): ++ if not filecmp.cmp(sisyphus_removeable_csv_path_pre, sisyphus_removeable_csv_path_post): ++ sisyphusdb = sqlite3.connect(sisyphus_database_path) ++ sisyphusdb.cursor().execute('''drop table if exists removeable_packages''') ++ sisyphusdb.cursor().execute('''create table removeable_packages (category TEXT,name TEXT,version TEXT,slot TEXT,description TEXT)''') ++ with open(sisyphus_removeable_csv_path_post) as sisyphus_removeable_csv: ++ for row in csv.reader(sisyphus_removeable_csv): ++ sisyphusdb.cursor().execute("insert into removeable_packages (category, name, version, slot, description) values (?, ?, ?, ?, ?);", row) ++ sisyphusdb.commit() ++ sisyphusdb.close() ++ shutil.move(sisyphus_removeable_csv_path_post, sisyphus_removeable_csv_path_pre) + + def sync_sisyphus_database_remote_packages_table(): + fetch_sisyphus_remote_packages_table_csv() + sync_sisyphus_remote_packages_table_csv() + ++def sync_sisyphus_database_removeable_packages_table(): ++ fetch_sisyphus_removeable_packages_table_csv() ++ sync_sisyphus_removeable_packages_table_csv() ++ ++@animation.wait('syncing remote databases') + def redcore_sync(): + check_if_root() + sync_redcore_portage_tree_and_desktop_overlay() + sync_redcore_portage_config() + sync_sisyphus_database_remote_packages_table() ++ sync_sisyphus_database_removeable_packages_table() + + def generate_sisyphus_local_packages_table_csv_pre(): + subprocess.check_call(['/usr/share/sisyphus/helpers/make_local_csv_pre']) # this is really hard to do in python, so we cheat with a bash helper script +@@ -171,13 +149,13 @@ def sync_sisyphus_spm_csv(): + sisyphusdb.close() + os.remove(sisyphus_spm_csv_path) + +-@animation.wait('syncing databases') ++@animation.wait('syncing local databases') + def sisyphus_pkg_spmsync(): + generate_sisyphus_spm_csv() + sync_sisyphus_spm_csv() + + def sisyphus_pkg_install(PKGLIST): +- check_sync() ++ redcore_sync() + generate_sisyphus_local_packages_table_csv_pre() + portage_call = subprocess.Popen(['emerge', '-a'] + PKGLIST) + atexit.register(kill_bg_portage, portage_call) +@@ -195,7 +173,7 @@ def sisyphus_pkg_auto_install(PKGLIST): + sync_sisyphus_local_packages_table_csv() + + def sisyphus_pkg_uninstall(PKGLIST): +- check_sync() ++ redcore_sync() + generate_sisyphus_local_packages_table_csv_pre() + portage_call = subprocess.Popen(['emerge', '--depclean', '-a'] + PKGLIST) + atexit.register(kill_bg_portage, portage_call) +@@ -213,7 +191,7 @@ def sisyphus_pkg_auto_uninstall(PKGLIST): + sync_sisyphus_local_packages_table_csv() + + def sisyphus_pkg_force_uninstall(PKGLIST): +- check_sync() ++ redcore_sync() + generate_sisyphus_local_packages_table_csv_pre() + portage_call = subprocess.Popen(['emerge', '--unmerge', '-a'] + PKGLIST) + atexit.register(kill_bg_portage, portage_call) +@@ -231,7 +209,7 @@ def sisyphus_pkg_auto_force_uninstall(PKGLIST): + sync_sisyphus_local_packages_table_csv() + + def sisyphus_pkg_remove_orphans(): +- check_sync() ++ redcore_sync() + generate_sisyphus_local_packages_table_csv_pre() + portage_call = subprocess.Popen(['emerge', '--depclean', '-a']) + atexit.register(kill_bg_portage, portage_call) +@@ -249,7 +227,7 @@ def sisyphus_pkg_auto_remove_orphans(): + sync_sisyphus_local_packages_table_csv() + + def sisyphus_pkg_system_upgrade(): +- check_sync() ++ redcore_sync() + generate_sisyphus_local_packages_table_csv_pre() + portage_call = subprocess.Popen(['emerge', '-uDaN', '--with-bdeps=y', '@world']) + atexit.register(kill_bg_portage, portage_call) +diff --git a/src/frontend/gui/sisyphus-gui.py b/src/frontend/gui/sisyphus-gui.py +index 0391869..f910bb1 100755 +--- a/src/frontend/gui/sisyphus-gui.py ++++ b/src/frontend/gui/sisyphus-gui.py +@@ -12,29 +12,32 @@ def __init__(self): + self.show() + + self.SEARCHFIELDS = OrderedDict ([ +- ('Category', 'cat'), +- ('Name', 'pn'), +- ('Description', 'descr') ++ ('Search by category', 'cat'), ++ ('Search by description', 'descr'), ++ ('Search by name', 'pn') + ]) + self.selectfield.addItems(self.SEARCHFIELDS.keys()) +- self.selectfield.setCurrentIndex(1) ++ self.selectfield.setCurrentIndex(2) + self.selectfield.currentIndexChanged.connect(self.setSearchField) +- ++ Sisyphus.SEARCHFIELD = self.SEARCHFIELDS['Search by name'] ++ + self.SEARCHFILTERS = OrderedDict ([ +- ('All', ''), +- ('Available', 'AND iv IS NULL'), +- ('Installed', 'AND iv IS NOT NULL'), +- ('Upgradable', 'AND iv < av'), +- ('Downgradable', 'AND iv > av') ++ ('All packages', ''), ++ ('Installed packages', 'AND iv IS NOT NULL'), ++ ('Installable packages', 'AND iv IS NULL'), ++ ('Removable packages', 'AND rmv = "yes"'), ++ ('Upgradable packages', 'AND iv <> av') + ]) ++ Sisyphus.SEARCHFILTER = self.SEARCHFILTERS['All packages'] ++ ++ Sisyphus.SEARCHTERM = "'%%'" ++ + self.selectfilter.addItems(self.SEARCHFILTERS.keys()) + self.selectfilter.setCurrentIndex(0) + self.selectfilter.currentIndexChanged.connect(self.setSearchFilter) +- +- Sisyphus.SEARCHTERM = "'%%'" +- Sisyphus.SEARCHFIELD = self.SEARCHFIELDS['Name'] +- Sisyphus.SEARCHFILTER = self.SEARCHFILTERS['All'] +- ++ ++ self.database.clicked.connect(self.rowClicked) ++ + self.input.textEdited.connect(self.filterDatabase) + + self.updateThread = UpdateThread() +@@ -66,36 +69,52 @@ def __init__(self): + + self.abort.clicked.connect(self.sisyphusExit) + +- def setSearchField(self): +- Sisyphus.SEARCHFIELD = self.SEARCHFIELDS[self.selectfield.currentText()] +- self.loadDatabase(Sisyphus.SEARCHFIELD,Sisyphus.SEARCHTERM,Sisyphus.SEARCHFILTER) +- +- def setSearchFilter(self): +- Sisyphus.SEARCHFILTER = self.SEARCHFILTERS[self.selectfilter.currentText()] +- self.loadDatabase(Sisyphus.SEARCHFIELD,Sisyphus.SEARCHTERM,Sisyphus.SEARCHFILTER) + + def centerOnScreen(self): + resolution = QtWidgets.QDesktopWidget().screenGeometry() + self.move((resolution.width() / 2) - (self.frameSize().width() / 2), + (resolution.height() / 2) - (self.frameSize().height() / 2)) ++ ++ def rowClicked(self): ++ Sisyphus.PKGSELECTED = len(self.database.selectionModel().selectedRows()) ++ self.showPackageCount() ++ ++ def showPackageCount(self): ++ self.statusBar().showMessage("Found: %d, Selected: %d packages" %(Sisyphus.PKGCOUNT, Sisyphus.PKGSELECTED)) ++ ++ def setSearchField(self): ++ Sisyphus.SEARCHFIELD = self.SEARCHFIELDS[self.selectfield.currentText()] ++ self.loadDatabase() ++ ++ def setSearchFilter(self): ++ Sisyphus.SEARCHFILTER = self.SEARCHFILTERS[self.selectfilter.currentText()] ++ self.loadDatabase() + +- def loadDatabase(self,searchField,searchTerm,searchFilter): +- with sqlite3.connect('/var/lib/sisyphus/db/sisyphus.db') as db: ++ def loadDatabase(self): ++ with sqlite3.connect(sisyphus_database_path) as db: + cursor=db.cursor() ++ FILTEROUT = "AND cat NOT LIKE 'virtual'" + cursor.execute('''SELECT + a.category AS cat, + a.name AS pn, + a.version AS av, + i.version AS iv, +- a.description AS descr ++ a.description AS descr, ++ CASE WHEN rm.name ISNULL THEN 'no' ELSE 'yes' END AS rmv + FROM remote_packages AS a + LEFT JOIN local_packages AS i + ON a.category = i.category + AND a.name = i.name + AND a.slot = i.slot +- WHERE %s LIKE %s %s +- ''' % (searchField, searchTerm, searchFilter)) ++ LEFT JOIN removeable_packages as rm ++ ON i.category = rm.category ++ AND i.name = rm.name ++ AND i.slot = rm.slot ++ WHERE %s LIKE %s %s %s ++ ''' % (Sisyphus.SEARCHFIELD, Sisyphus.SEARCHTERM, Sisyphus.SEARCHFILTER, FILTEROUT)) + rows = cursor.fetchall() ++ Sisyphus.PKGCOUNT = len(rows) ++ Sisyphus.PKGSELECTED = 0 + model = QtGui.QStandardItemModel(len(rows), 5) + model.setHorizontalHeaderLabels(['Category', 'Name', 'Available Version', 'Installed Version', 'Description']) + for row in rows: +@@ -104,20 +123,21 @@ def loadDatabase(self,searchField,searchTerm,searchFilter): + item = QtGui.QStandardItem("%s"%(row[column])) + model.setItem(indx, column, item) + self.database.setModel(model) ++ self.showPackageCount() + + def filterDatabase(self): + search = self.input.text() + Sisyphus.SEARCHTERM = "'%" + search + "%'" +- self.loadDatabase(Sisyphus.SEARCHFIELD,Sisyphus.SEARCHTERM,Sisyphus.SEARCHFILTER) ++ self.loadDatabase() + + def updateSystem(self): +- self.loadDatabase(Sisyphus.SEARCHFIELD,Sisyphus.SEARCHTERM,Sisyphus.SEARCHFILTER) ++ self.loadDatabase() + self.updateThread.start() + + def packageInstall(self): + indexes = self.database.selectionModel().selectedRows(1) + if len(indexes) == 0: +- self.input.setText("Please select at least one package!!!") ++ self.statusBar().showMessage("No package selected, please pick at least one!", 3000) + else: + Sisyphus.PKGLIST = [] + for index in sorted(indexes): +@@ -127,7 +147,7 @@ def packageInstall(self): + def packageUninstall(self): + indexes = self.database.selectionModel().selectedRows(1) + if len(indexes) == 0: +- self.input.setText("Please select at least one package!!!") ++ self.statusBar().showMessage("No package selected, please pick at least one!", 3000) + else: + Sisyphus.PKGLIST = [] + for index in sorted(indexes): +@@ -142,7 +162,7 @@ def orphansRemove(self): + + def jobDone(self): + self.hideProgressBar() +- self.loadDatabase(Sisyphus.SEARCHFIELD,Sisyphus.SEARCHTERM,Sisyphus.SEARCHFILTER) ++ self.loadDatabase() + + def showProgressBar(self): + self.hideButtons() diff --git a/app-portage/sisyphus/sisyphus-0.1709.ebuild b/app-portage/sisyphus/sisyphus-0.1709-r1.ebuild index f8277cb9..07a636be 100644 --- a/app-portage/sisyphus/sisyphus-0.1709.ebuild +++ b/app-portage/sisyphus/sisyphus-0.1709-r1.ebuild @@ -2,19 +2,15 @@ # Distributed under the terms of the GNU General Public License v2 # $Id$ -EAPI=6 +EAPI=5 PYTHON_COMPAT=( python3_4 ) -inherit eutils git-r3 python-r1 +inherit eutils python-r1 DESCRIPTION="A simple portage python wrapper which works like other package managers(apt-get/yum/dnf)" HOMEPAGE="http://redcorelinux.org" - -EGIT_BRANCH=master -EGIT_REPO_URI="https://gitlab.com/redcore/sisyphus.git" -EGIT_COMMIT="a7c7d9a93cb86e11bf27589bea8789ef1cba4550" - +SRC_URI="https://github.com/redcorelinux/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz" LICENSE="GPL-2" SLOT="0" KEYWORDS="amd64 x86" @@ -28,6 +24,10 @@ RDEPEND="${DEPEND} sys-apps/portage[${PYTHON_USEDEP}] gui? ( dev-python/PyQt5[designer,gui,widgets,${PYTHON_USEDEP}] )" +src_prepare() { + epatch ${FILESDIR}/${P}-r1.patch +} + src_install() { default dosym /usr/share/${PN}/${PN}-cli.py /usr/bin/${PN} |