From f7e54cc8a29e5fa319ce21d6ec268e210397740a Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Sat, 24 Jun 2017 21:55:37 +0100 Subject: write a proper Makefile, rearrange source code a bit --- Makefile | 54 +++ backend/libsisyphus.py | 229 ---------- backend/libsisyphus.sh | 179 -------- frontend/cli/sisyphus-cli | 116 ----- frontend/cli/sisyphus-cli.py | 33 -- frontend/gui/Makefile | 40 -- frontend/gui/accesories.py | 50 --- frontend/gui/desktop/sisyphus-gui.desktop | 7 - frontend/gui/desktop/sisyphus-gui.png | Bin 74727 -> 0 bytes frontend/gui/development.py | 50 --- frontend/gui/everything.py | 61 --- frontend/gui/games.py | 77 ---- frontend/gui/graphics.py | 50 --- frontend/gui/icon/category_accessories.png | Bin 10321 -> 0 bytes frontend/gui/icon/category_all.png | Bin 16629 -> 0 bytes frontend/gui/icon/category_development.png | Bin 6675 -> 0 bytes frontend/gui/icon/category_games.png | Bin 3165 -> 0 bytes frontend/gui/icon/category_graphics.png | Bin 31803 -> 0 bytes frontend/gui/icon/category_internet.png | Bin 7535 -> 0 bytes frontend/gui/icon/category_local.png | Bin 5384 -> 0 bytes frontend/gui/icon/category_multimedia.png | Bin 5276 -> 0 bytes frontend/gui/icon/category_office.png | Bin 5638 -> 0 bytes frontend/gui/icon/category_system.png | Bin 9621 -> 0 bytes frontend/gui/icon/package_install.png | Bin 498 -> 0 bytes frontend/gui/icon/package_search.png | Bin 2959 -> 0 bytes frontend/gui/icon/package_uninstall.png | Bin 250 -> 0 bytes frontend/gui/icon/remove_orphans.png | Bin 354 -> 0 bytes frontend/gui/icon/system_upgrade.png | Bin 1089 -> 0 bytes frontend/gui/icon/window_close.png | Bin 971 -> 0 bytes frontend/gui/icon/window_icon.png | Bin 2691 -> 0 bytes frontend/gui/internet.py | 100 ----- frontend/gui/local.py | 50 --- frontend/gui/multimedia.py | 50 --- frontend/gui/office.py | 84 ---- frontend/gui/org.redcorelinux.sisyphus-gui.policy | 22 - frontend/gui/sisyphus-gui | 12 - frontend/gui/sisyphus-gui-pkexec | 2 - frontend/gui/sisyphus-gui.py | 106 ----- frontend/gui/system.py | 50 --- frontend/gui/ui/accesories.ui | 220 --------- frontend/gui/ui/development.ui | 220 --------- frontend/gui/ui/everything.ui | 220 --------- frontend/gui/ui/games.ui | 220 --------- frontend/gui/ui/graphics.ui | 220 --------- frontend/gui/ui/internet.ui | 220 --------- frontend/gui/ui/local.ui | 217 --------- frontend/gui/ui/multimedia.ui | 220 --------- frontend/gui/ui/office.ui | 220 --------- frontend/gui/ui/sisyphus-gui.ui | 520 ---------------------- frontend/gui/ui/system.ui | 220 --------- helpers/make_local_csv_post | 21 - helpers/make_local_csv_pre | 21 - org.redcorelinux.sisyphus-gui.policy | 22 + sisyphus-gui | 12 + sisyphus-gui-pkexec | 2 + sisyphus-gui.desktop | 7 + sisyphus-gui.png | Bin 0 -> 74727 bytes src/backend/libsisyphus.sh | 179 ++++++++ src/frontend/cli/sisyphus-cli.py | 33 ++ src/frontend/cli/sisyphus-cli.sh | 116 +++++ src/frontend/gui/accesories.py | 50 +++ src/frontend/gui/development.py | 50 +++ src/frontend/gui/everything.py | 61 +++ src/frontend/gui/games.py | 77 ++++ src/frontend/gui/graphics.py | 50 +++ src/frontend/gui/icon/category_accessories.png | Bin 0 -> 10321 bytes src/frontend/gui/icon/category_all.png | Bin 0 -> 16629 bytes src/frontend/gui/icon/category_development.png | Bin 0 -> 6675 bytes src/frontend/gui/icon/category_games.png | Bin 0 -> 3165 bytes src/frontend/gui/icon/category_graphics.png | Bin 0 -> 31803 bytes src/frontend/gui/icon/category_internet.png | Bin 0 -> 7535 bytes src/frontend/gui/icon/category_local.png | Bin 0 -> 5384 bytes src/frontend/gui/icon/category_multimedia.png | Bin 0 -> 5276 bytes src/frontend/gui/icon/category_office.png | Bin 0 -> 5638 bytes src/frontend/gui/icon/category_system.png | Bin 0 -> 9621 bytes src/frontend/gui/icon/package_install.png | Bin 0 -> 498 bytes src/frontend/gui/icon/package_search.png | Bin 0 -> 2959 bytes src/frontend/gui/icon/package_uninstall.png | Bin 0 -> 250 bytes src/frontend/gui/icon/remove_orphans.png | Bin 0 -> 354 bytes src/frontend/gui/icon/system_upgrade.png | Bin 0 -> 1089 bytes src/frontend/gui/icon/window_close.png | Bin 0 -> 971 bytes src/frontend/gui/icon/window_icon.png | Bin 0 -> 2691 bytes src/frontend/gui/internet.py | 100 +++++ src/frontend/gui/local.py | 50 +++ src/frontend/gui/multimedia.py | 50 +++ src/frontend/gui/office.py | 84 ++++ src/frontend/gui/sisyphus-gui.py | 106 +++++ src/frontend/gui/system.py | 50 +++ src/frontend/gui/ui/accesories.ui | 220 +++++++++ src/frontend/gui/ui/development.ui | 220 +++++++++ src/frontend/gui/ui/everything.ui | 220 +++++++++ src/frontend/gui/ui/games.ui | 220 +++++++++ src/frontend/gui/ui/graphics.ui | 220 +++++++++ src/frontend/gui/ui/internet.ui | 220 +++++++++ src/frontend/gui/ui/local.ui | 217 +++++++++ src/frontend/gui/ui/multimedia.ui | 220 +++++++++ src/frontend/gui/ui/office.ui | 220 +++++++++ src/frontend/gui/ui/sisyphus-gui.ui | 520 ++++++++++++++++++++++ src/frontend/gui/ui/system.ui | 220 +++++++++ src/helpers/make_local_csv_post | 21 + src/helpers/make_local_csv_pre | 21 + 101 files changed, 3912 insertions(+), 4127 deletions(-) create mode 100644 Makefile delete mode 100755 backend/libsisyphus.py delete mode 100755 backend/libsisyphus.sh delete mode 100755 frontend/cli/sisyphus-cli delete mode 100755 frontend/cli/sisyphus-cli.py delete mode 100644 frontend/gui/Makefile delete mode 100755 frontend/gui/accesories.py delete mode 100755 frontend/gui/desktop/sisyphus-gui.desktop delete mode 100644 frontend/gui/desktop/sisyphus-gui.png delete mode 100755 frontend/gui/development.py delete mode 100755 frontend/gui/everything.py delete mode 100755 frontend/gui/games.py delete mode 100755 frontend/gui/graphics.py delete mode 100644 frontend/gui/icon/category_accessories.png delete mode 100644 frontend/gui/icon/category_all.png delete mode 100644 frontend/gui/icon/category_development.png delete mode 100644 frontend/gui/icon/category_games.png delete mode 100644 frontend/gui/icon/category_graphics.png delete mode 100644 frontend/gui/icon/category_internet.png delete mode 100644 frontend/gui/icon/category_local.png delete mode 100644 frontend/gui/icon/category_multimedia.png delete mode 100644 frontend/gui/icon/category_office.png delete mode 100644 frontend/gui/icon/category_system.png delete mode 100644 frontend/gui/icon/package_install.png delete mode 100644 frontend/gui/icon/package_search.png delete mode 100644 frontend/gui/icon/package_uninstall.png delete mode 100644 frontend/gui/icon/remove_orphans.png delete mode 100644 frontend/gui/icon/system_upgrade.png delete mode 100644 frontend/gui/icon/window_close.png delete mode 100644 frontend/gui/icon/window_icon.png delete mode 100755 frontend/gui/internet.py delete mode 100755 frontend/gui/local.py delete mode 100755 frontend/gui/multimedia.py delete mode 100755 frontend/gui/office.py delete mode 100644 frontend/gui/org.redcorelinux.sisyphus-gui.policy delete mode 100755 frontend/gui/sisyphus-gui delete mode 100755 frontend/gui/sisyphus-gui-pkexec delete mode 100755 frontend/gui/sisyphus-gui.py delete mode 100755 frontend/gui/system.py delete mode 100644 frontend/gui/ui/accesories.ui delete mode 100644 frontend/gui/ui/development.ui delete mode 100644 frontend/gui/ui/everything.ui delete mode 100644 frontend/gui/ui/games.ui delete mode 100644 frontend/gui/ui/graphics.ui delete mode 100644 frontend/gui/ui/internet.ui delete mode 100644 frontend/gui/ui/local.ui delete mode 100644 frontend/gui/ui/multimedia.ui delete mode 100644 frontend/gui/ui/office.ui delete mode 100644 frontend/gui/ui/sisyphus-gui.ui delete mode 100644 frontend/gui/ui/system.ui delete mode 100755 helpers/make_local_csv_post delete mode 100755 helpers/make_local_csv_pre create mode 100644 org.redcorelinux.sisyphus-gui.policy create mode 100755 sisyphus-gui create mode 100755 sisyphus-gui-pkexec create mode 100755 sisyphus-gui.desktop create mode 100644 sisyphus-gui.png create mode 100755 src/backend/libsisyphus.sh create mode 100755 src/frontend/cli/sisyphus-cli.py create mode 100755 src/frontend/cli/sisyphus-cli.sh create mode 100755 src/frontend/gui/accesories.py create mode 100755 src/frontend/gui/development.py create mode 100755 src/frontend/gui/everything.py create mode 100755 src/frontend/gui/games.py create mode 100755 src/frontend/gui/graphics.py create mode 100644 src/frontend/gui/icon/category_accessories.png create mode 100644 src/frontend/gui/icon/category_all.png create mode 100644 src/frontend/gui/icon/category_development.png create mode 100644 src/frontend/gui/icon/category_games.png create mode 100644 src/frontend/gui/icon/category_graphics.png create mode 100644 src/frontend/gui/icon/category_internet.png create mode 100644 src/frontend/gui/icon/category_local.png create mode 100644 src/frontend/gui/icon/category_multimedia.png create mode 100644 src/frontend/gui/icon/category_office.png create mode 100644 src/frontend/gui/icon/category_system.png create mode 100644 src/frontend/gui/icon/package_install.png create mode 100644 src/frontend/gui/icon/package_search.png create mode 100644 src/frontend/gui/icon/package_uninstall.png create mode 100644 src/frontend/gui/icon/remove_orphans.png create mode 100644 src/frontend/gui/icon/system_upgrade.png create mode 100644 src/frontend/gui/icon/window_close.png create mode 100644 src/frontend/gui/icon/window_icon.png create mode 100755 src/frontend/gui/internet.py create mode 100755 src/frontend/gui/local.py create mode 100755 src/frontend/gui/multimedia.py create mode 100755 src/frontend/gui/office.py create mode 100755 src/frontend/gui/sisyphus-gui.py create mode 100755 src/frontend/gui/system.py create mode 100644 src/frontend/gui/ui/accesories.ui create mode 100644 src/frontend/gui/ui/development.ui create mode 100644 src/frontend/gui/ui/everything.ui create mode 100644 src/frontend/gui/ui/games.ui create mode 100644 src/frontend/gui/ui/graphics.ui create mode 100644 src/frontend/gui/ui/internet.ui create mode 100644 src/frontend/gui/ui/local.ui create mode 100644 src/frontend/gui/ui/multimedia.ui create mode 100644 src/frontend/gui/ui/office.ui create mode 100644 src/frontend/gui/ui/sisyphus-gui.ui create mode 100644 src/frontend/gui/ui/system.ui create mode 100755 src/helpers/make_local_csv_post create mode 100755 src/helpers/make_local_csv_pre diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..5d2c1e1 --- /dev/null +++ b/Makefile @@ -0,0 +1,54 @@ +SUBDIRS = +DESTDIR = +UBINDIR ?= /usr/bin +DESKTOPDIR ?= /usr/share/applications +PIXMAPDIR ?= /usr/share/pixmaps +SISYPHUSDATADIR ?= /usr/share/sisyphus +SISYPHUSSHLIBDIR ?= /usr/lib64/sisyphus +SISYPHUSPYLIBDIR ?= /usr/lib64/python3.4 +POLKITDIR ?= /usr/share/polkit-1/actions + +all: + for d in $(SUBDIRS); do $(MAKE) -C $$d; done + +clean: + for d in $(SUBDIRS); do $(MAKE) -C $$d clean; done + +install: + for d in $(SUBDIRS); do $(MAKE) -C $$d install; done + + install -d $(DESTDIR)$(UBINDIR) + install -m 0755 sisyphus-gui $(DESTDIR)$(UBINDIR)/ + install -m 0755 sisyphus-gui-pkexec $(DESTDIR)$(UBINDIR)/ + install -m 0755 src/frontend/cli/sisyphus-cli.sh $(DESTDIR)$(UBINDIR)/ + install -m 0755 src/frontend/cli/sisyphus-cli.py $(DESTDIR)$(UBINDIR)/ + install -d $(DESTDIR)$(SISYPHUSSHLIBDIR) + install -m 0644 src/backend/libsisyphus.sh $(DESTDIR)$(SISYPHUSSHLIBDIR)/ + install -d $(DESTDIR)$(SISYPHUSPYLIBDIR) + install -m 0644 src/backend/libsisyphus.py $(DESTDIR)$(SISYPHUSPYLIBDIR)/ + install -d $(DESTDIR)$(SISYPHUSDATADIR) + install -d $(DESTDIR)$(SISYPHUSDATADIR)/helpers + install -d $(DESTDIR)$(SISYPHUSDATADIR)/icon + install -d $(DESTDIR)$(SISYPHUSDATADIR)/ui + install -m 0755 src/helpers/* $(DESTDIR)$(SISYPHUSDATADIR)/helpers/ + install -m 0755 src/frontend/gui/*.py $(DESTDIR)$(SISYPHUSDATADIR)/ + install -m 0755 src/frontend/gui/icon/* $(DESTDIR)$(SISYPHUSDATADIR)/icon/ + install -m 0755 src/frontend/gui/ui/* $(DESTDIR)$(SISYPHUSDATADIR)/ui/ + install -d $(DESTDIR)$(DESKTOPDIR) + install -m 0755 sisyphus-gui.desktop $(DESTDIR)$(DESKTOPDIR)/ + install -d $(DESTDIR)$(PIXMAPDIR) + install -m 0644 sisyphus-gui.png $(DESTDIR)$(PIXMAPDIR) + install -d $(DESTDIR)$(POLKITDIR) + install -m 0644 org.redcorelinux.sisyphus-gui.policy $(DESTDIR)$(POLKITDIR)/ + +uninstall: + rm -rf $(DESTDIR)$(UBINDIR)/sisyphus-cli.sh + rm -rf $(DESTDIR)$(UBINDIR)/sisyphus-cli.py + rm -rf $(DESTDIR)$(UBINDIR)/sisyphus-gui + rm -rf $(DESTDIR)$(UBINDIR)/sisyphus-gui-pkexec + rm -rf $(DESTDIR)$(DESKTOPDIR)/sisyphus-gui.desktop + rm -rf $(DESTDIR)$(PIXMAPDIR)/sisyphus-gui.png + rm -rf $(DESTDIR)$(POLKITDIR)/org.redcorelinux.sisyphus-gui.policy + rm -rf $(DESTDIR)$(SISYPHUSDATADIR) + rm -rf $(DESTDIR)$(SISYPHUSSHLIBDIR) + rm -rf $(DESTDIR)$(SISYPHUSPYLIBDIR)/libsisyphus.py diff --git a/backend/libsisyphus.py b/backend/libsisyphus.py deleted file mode 100755 index 5dff073..0000000 --- a/backend/libsisyphus.py +++ /dev/null @@ -1,229 +0,0 @@ -#!/usr/bin/python3 - -import csv -import filecmp -import os -import shutil -import sqlite3 -import sys -import urllib3 -import subprocess - -redcore_portage_tree_path = '/usr/portage' -redcore_desktop_overlay_path = '/var/lib/layman/redcore-desktop' -redcore_portage_config_path = '/opt/redcore-build' - -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_local_csv_path_pre = '/var/lib/sisyphus/csv/local_preinst.csv' -sisyphus_local_csv_path_post = '/var/lib/sisyphus/csv/local_postinst.csv' -sisyphus_database_path = '/var/lib/sisyphus/db/sisyphus.db' -def check_if_root(): - if not os.getuid() == 0: - sys.exit("you need root permissions to do this. exiting!") - -def check_if_srcmode(): - portage_srcmode_make_conf = '/opt/redcore-build/conf/intel/portage/make.conf.amd64-srcmode' - portage_make_conf_symlink = '/etc/portage/make.conf' - - if os.path.islink(portage_make_conf_symlink) and os.path.realpath(portage_make_conf_symlink) == portage_srcmode_make_conf: - print("the system is set to srcmode (full gentoo), refusing to run!") - sys.exit(1) - -def check_redcore_portage_tree(): - os.chdir(redcore_portage_tree_path) - subprocess.call(['git', 'remote', 'update']) - 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("redcore desktop portage tree is out-of-date. run 'sisyphus update' first!") - sys.exit(1) - -def check_redcore_desktop_overlay(): - os.chdir(redcore_desktop_overlay_path) - subprocess.call(['git', 'remote', 'update']) - 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("redcore desktop overlay is out-of-date. run 'sisyphus update' first!") - sys.exit(1) - -def check_redcore_portage_config(): - os.chdir(redcore_portage_config_path) - subprocess.call(['git', 'remote', 'update']) - 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("redcore desktop portage config is out-of-date. run 'sisyphus update' first!") - sys.exit(1) - -def fetch_sisyphus_remote_packages_table_csv(): - http = urllib3.PoolManager() - - if not os.path.isfile(sisyphus_remote_csv_path_pre): - os.mknod(sisyphus_remote_csv_path_pre) - 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) - else: - 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("sisyphus database remote_packages table is out-of-date. run 'sisyphus update' first!") - 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 check_sync(): - check_if_root() - check_redcore_portage_tree() - check_redcore_desktop_overlay() - check_redcore_portage_config() - check_sisyphus_remote_packages_table() - -def sync_redcore_portage_tree_and_desktop_overlay(): - subprocess.call(['emerge', '--sync']) - -def sync_redcore_portage_config(): - os.chdir(redcore_portage_config_path) - print(">>> Syncing 'portage config' into '/etc/portage'...") - print("/usr/bin/git pull") - subprocess.call(['git', 'pull']) - print("=== Sync completed for 'portage config'") - -def sync_sisyphus_remote_packages_table_csv(): - if not filecmp.cmp(sisyphus_remote_csv_path_pre, sisyphus_remote_csv_path_post): - print(">>> Syncing 'sisyphus database remote_packages table' into '/var/lib/sisyphus/db/sisyphus.db'") - print("/usr/bin/sqlite3 /var/lib/sisyphus/db/sisyphus.db") - sisyphusdb = sqlite3.connect(sisyphus_database_path) - sisyphusdb.cursor().execute('''drop table if exists remote_packages''') - sisyphusdb.cursor().execute('''create table remote_packages (category TEXT,name TEXT,version TEXT,slot TEXT,description TEXT)''') - with open(sisyphus_remote_csv_path_post) as sisyphus_remote_csv: - for row in csv.reader(sisyphus_remote_csv): - sisyphusdb.cursor().execute("insert into remote_packages (category, name, version, slot, description) values (?, ?, ?, ?, ?);", row) - sisyphusdb.commit() - sisyphusdb.close() - print("=== Sync completed for 'sisyphus database remote_packages table'") - else: - print(">>> Syncing 'sisyphus database remote_packages table' into '/var/lib/sisyphus/db/sisyphus.db'") - print("/usr/bin/sqlite3 /var/lib/sisyphus/db/sisyphus.db") - print("Already up-to-date.") - print("=== Sync completed for 'sisyphus database remote_packages table'") - shutil.move(sisyphus_remote_csv_path_post, sisyphus_remote_csv_path_pre) - -def sync_sisyphus_database_remote_packages_table(): - fetch_sisyphus_remote_packages_table_csv() - sync_sisyphus_remote_packages_table_csv() - -def redcore_sync(): - check_if_root() - sync_redcore_portage_tree_and_desktop_overlay() - sync_redcore_portage_config() - sync_sisyphus_database_remote_packages_table() - -def generate_sisyphus_local_packages_table_csv_pre(): - subprocess.call(['/usr/share/sisyphus-cli/helpers/make_local_csv_pre']) # this is really hard to do in python, so we cheat with a bash helper script - -def generate_sisyphus_local_packages_table_csv_post(): - subprocess.call(['/usr/share/sisyphus-cli/helpers/make_local_csv_post']) # this is really hard to do in python, so we cheat with a bash helper script - -def sync_sisyphus_local_packages_table_csv(): - if filecmp.cmp(sisyphus_local_csv_path_pre, sisyphus_local_csv_path_post): - print("sisyphus database local_packages table is in sync with portage database, nothing to do...") - else: - print("sisyphus database local_packages table is not in sync with portage database, syncing now...") - sisyphusdb = sqlite3.connect(sisyphus_database_path) - sisyphusdb.cursor().execute('''drop table if exists local_packages''') - sisyphusdb.cursor().execute('''create table local_packages (category TEXT,name TEXT,version TEXT,slot TEXT,description TEXT)''') - with open(sisyphus_local_csv_path_post) as sisyphus_local_csv: - for row in csv.reader(sisyphus_local_csv): - sisyphusdb.cursor().execute("insert into local_packages (category, name, version, slot, description) values (?, ?, ?, ?, ?);", row) - sisyphusdb.commit() - sisyphusdb.close() - shutil.move(sisyphus_local_csv_path_post, sisyphus_local_csv_path_pre) - -def sisyphus_pkg_install(): - check_sync() - generate_sisyphus_local_packages_table_csv_pre() - subprocess.call(['emerge', '-a'] + sys.argv[2:]) - generate_sisyphus_local_packages_table_csv_post() - sync_sisyphus_local_packages_table_csv() - -def sisyphus_pkg_uninstall(): - check_sync() - generate_sisyphus_local_packages_table_csv_pre() - subprocess.call(['emerge', '--depclean', '-a'] + sys.argv[2:]) - generate_sisyphus_local_packages_table_csv_post() - sync_sisyphus_local_packages_table_csv() - -def sisyphus_pkg_force_uninstall(): - check_sync() - generate_sisyphus_local_packages_table_csv_pre() - subprocess.call(['emerge', '--unmerge', '-a'] + sys.argv[2:]) - generate_sisyphus_local_packages_table_csv_post() - sync_sisyphus_local_packages_table_csv() - -def sisyphus_pkg_remove_orphans(): - check_sync() - generate_sisyphus_local_packages_table_csv_pre() - subprocess.call(['emerge', '--depclean', '-a']) - generate_sisyphus_local_packages_table_csv_post() - sync_sisyphus_local_packages_table_csv() - -def sisyphus_pkg_system_upgrade(): - check_sync() - generate_sisyphus_local_packages_table_csv_pre() - subprocess.call(['emerge', '-uDaN', '--with-bdeps=y', '@world']) - generate_sisyphus_local_packages_table_csv_post() - sync_sisyphus_local_packages_table_csv() - -def sisyphus_pkg_auto_install(): - redcore_sync() - generate_sisyphus_local_packages_table_csv_pre() - subprocess.call(['emerge'] + sys.argv[2:]) - generate_sisyphus_local_packages_table_csv_post() - sync_sisyphus_local_packages_table_csv() - -def sisyphus_pkg_auto_uninstall(): - redcore_sync() - generate_sisyphus_local_packages_table_csv_pre() - subprocess.call(['emerge', '--depclean'] + sys.argv[2:]) - generate_sisyphus_local_packages_table_csv_post() - sync_sisyphus_local_packages_table_csv() - -def sisyphus_pkg_auto_force_uninstall(): - redcore_sync() - generate_sisyphus_local_packages_table_csv_pre() - subprocess.call(['emerge', '--unmerge'] + sys.argv[2:]) - generate_sisyphus_local_packages_table_csv_post() - sync_sisyphus_local_packages_table_csv() - -def sisyphus_pkg_auto_remove_orphans(): - redcore_sync() - generate_sisyphus_local_packages_table_csv_pre() - subprocess.call(['emerge', '--depclean', '-q']) - generate_sisyphus_local_packages_table_csv_post() - sync_sisyphus_local_packages_table_csv() - -def sisyphus_pkg_auto_system_upgrade(): - redcore_sync() - generate_sisyphus_local_packages_table_csv_pre() - subprocess.call(['emerge', '-uDN', '--with-bdeps=y', '@world']) - generate_sisyphus_local_packages_table_csv_post() - sync_sisyphus_local_packages_table_csv() - -def sisyphus_pkg_search(): - subprocess.call(['emerge', '--search'] + sys.argv[2:]) - -def sisyphus_pkg_system_update(): - redcore_sync() diff --git a/backend/libsisyphus.sh b/backend/libsisyphus.sh deleted file mode 100755 index 530f9bf..0000000 --- a/backend/libsisyphus.sh +++ /dev/null @@ -1,179 +0,0 @@ -#!/usr/bin/env bash - -# import gentoo functions -source /lib/gentoo/functions.sh - -checkroot () { - if [[ "$(whoami)" != root ]] ; then - eerror "You're not root?...No cookies for you, go away !!!" - exit 1 - fi -} - -checksystemmode() { - if [[ "$(readlink -f "/etc/portage/make.conf")" = /opt/redcore-build/conf/intel/portage/make.conf.amd64-srcmode ]] ; then - eerror "The system is set to srcmode (full Gentoo mode), cowardly refusing to run!" - exit 1 - fi -} - -checkportageconfig () { - pushd /opt/redcore-build > /dev/null 2>&1 - git remote update > /dev/null 2>&1 - export local confhash=$(git rev-parse @) - export local rconfhash=$(git rev-parse @{u}) - if [ $confhash != $rconfhash ] ; then - eerror "Portage config is out-of-date, run "sisyphus update" first" - exit 1 - fi - popd > /dev/null 2>&1 -} - -checkportagetree () { - pushd /usr/portage > /dev/null 2>&1 - git remote update > /dev/null 2>&1 - export local treehash=$(git rev-parse @) - export local rtreehash=$(git rev-parse @{u}) - if [ $treehash != $rtreehash ] ; then - eerror "Portage tree is out-of-date, run "sisyphus update" first" - exit 1 - fi - popd > /dev/null 2>&1 -} - -checkredcoreoverlay () { - pushd /var/lib/layman/redcore-desktop > /dev/null 2>&1 - git remote update > /dev/null 2>&1 - export local overlayhash=$(git rev-parse @) - export local roverlayhash=$(git rev-parse @{u}) - if [ $overlayhash != $roverlayhash ] ; then - eerror "Redcore Desktop overlay is out-of-date, run "sisyphus update" first" - exit 1 - fi -} - -remotedbcsvget () { - if [[ ! -f /var/lib/sisyphus/csv/remote_preinst.csv ]] ; then - pushd /var/lib/sisyphus/csv > /dev/null 2>&1 - touch remote_preinst.csv - wget -c http://mirror.math.princeton.edu/pub/redcorelinux/csv/remote_preinst.csv -O remote_postinst.csv > /dev/null 2>&1 - popd > /dev/null 2>&1 - elif [[ -f /var/lib/sisyphus/csv/remote_preinst.csv ]] ; then - pushd /var/lib/sisyphus/csv > /dev/null 2>&1 - wget -c http://mirror.math.princeton.edu/pub/redcorelinux/csv/remote_preinst.csv -O remote_postinst.csv > /dev/null 2>&1 - popd > /dev/null 2>&1 - fi -} - -remotedbcsvcheck () { - if ! cmp /var/lib/sisyphus/csv/remote_preinst.csv /var/lib/sisyphus/csv/remote_postinst.csv > /dev/null 2>&1 ; then - eerror "SisyphusDB : "remote_packages" table is out-of-date, run "sisyphus update" first" - rm -rf /var/lib/sisyphus/csv/remote_postinst.csv - exit 1 - elif cmp /var/lib/sisyphus/csv/remote_preinst.csv /var/lib/sisyphus/csv/remote_postinst.csv > /dev/null 2>&1 ; then - rm -rf /var/lib/sisyphus/csv/remote_postinst.csv - fi -} - -checkremotedb () { - remotedbcsvget - remotedbcsvcheck -} - -checksync () { - checkroot - checkportagetree - checkredcoreoverlay - checkportageconfig - checkremotedb -} - -syncrepos () { - emerge --sync -} - -syncportageconfig () { - pushd /opt/redcore-build > /dev/null 2>&1 - echo ">>> Syncing 'portage config' into '/etc/portage'..." - echo "/usr/bin/git pull" - git pull - echo "=== Sync completed for 'portage config'" - popd > /dev/null 2>&1 -} - -remotedbcsvsync () { - if ! cmp /var/lib/sisyphus/csv/remote_preinst.csv /var/lib/sisyphus/csv/remote_postinst.csv > /dev/null 2>&1 ; then - echo ">>> Syncing 'SisyphusDB remote_packages' into '/var/lib/sisyphus/db/sisyphus.db'" - echo "/usr/bin/sqlite3 /var/lib/sisyphus/db/sisyphus.db" - pushd /var/lib/sisyphus/db > /dev/null 2>&1 - sqlite3 -echo sisyphus.db<<-EXIT_HERE - drop table if exists remote_packages; - create table remote_packages (category TEXT,name TEXT,version TEXT,slot TEXT,description TEXT); - .mode csv - .import /var/lib/sisyphus/csv/remote_postinst.csv remote_packages - EXIT_HERE - popd > /dev/null 2>&1 - echo "=== Sync completed for 'SisyphusDB remote_packages'" - elif cmp /var/lib/sisyphus/csv/remote_preinst.csv /var/lib/sisyphus/csv/remote_postinst.csv > /dev/null 2>&1 ; then - echo ">>> Syncing 'SisyphusDB remote_packages' into '/var/lib/sisyphus/db/sisyphus.db'" - echo "/usr/bin/sqlite3 /var/lib/sisyphus/db/sisyphus.db" - echo "Already up-to-date." - echo "=== Sync completed for 'SisyphusDB remote_packages'" - fi - mv /var/lib/sisyphus/csv/remote_postinst.csv /var/lib/sisyphus/csv/remote_preinst.csv -} - -syncremotedb() { - remotedbcsvget - remotedbcsvsync -} - -redcoresync () { - checkroot - syncrepos - syncportageconfig - syncremotedb -} - -localdbcsvpre () { - if [[ ! -f /var/lib/sisyphus/csv/local_preinst.csv ]] ; then - for i in $(qlist -ICv); do - pushd /var/db/pkg/$i > /dev/null 2>&1 - echo "$(> /var/lib/sisyphus/csv/local_preinst.csv - popd > /dev/null 2>&1 - done - fi -} - -localdbcsvpost () { - for i in $(qlist -ICv); do - pushd /var/db/pkg/$i > /dev/null 2>&1 - echo "$(> /var/lib/sisyphus/csv/local_postinst.csv - popd > /dev/null 2>&1 - done -} - -localdbcsvsync () { - if cmp /var/lib/sisyphus/csv/local_preinst.csv /var/lib/sisyphus/csv/local_postinst.csv > /dev/null 2>&1 ; then - einfo "'PortageDB' && 'SisyphusDB local_packages' are in sync, nothing to do..." - else - einfo "'PortageDB' && 'SisyphusDB local_packages' are out of sync, syncing now..." - echo "/usr/bin/sqlite3 /var/lib/sisyphus/db/sisyphus.db" - pushd /var/lib/sisyphus/db > /dev/null 2>&1 - sqlite3 -echo sisyphus.db<<-EXIT_HERE - drop table if exists local_packages; - create table local_packages (category TEXT,name TEXT,version TEXT,slot TEXT,description TEXT); - .mode csv - .import /var/lib/sisyphus/csv/local_postinst.csv local_packages - EXIT_HERE - popd > /dev/null 2>&1 - einfo "'PortageDB' && 'SisyphusDB local_packages' resync complete..." - fi - mv /var/lib/sisyphus/csv/local_postinst.csv /var/lib/sisyphus/csv/local_preinst.csv -} - -updatelocaldb () { - checkroot - localdbcsvpost - localdbcsvsync -} diff --git a/frontend/cli/sisyphus-cli b/frontend/cli/sisyphus-cli deleted file mode 100755 index 79023aa..0000000 --- a/frontend/cli/sisyphus-cli +++ /dev/null @@ -1,116 +0,0 @@ -#!/usr/bin/env bash - -source /usr/lib/sisyphus/libsisyphus.sh - -checksystemmode - -action=$1 -shift - -case "$action" in - install) - checksync - localdbcsvpre - emerge -a "$@" - updatelocaldb - ;; - uninstall) - checksync - localdbcsvpre - emerge --depclean -a "$@" - updatelocaldb - ;; - force-uninstall) - checksync - localdbcsvpre - emerge --unmerge -a "$@" - updatelocaldb - ;; - remove-orphans) - checksync - localdbcsvpre - emerge --depclean -a - updatelocaldb - ;; - upgrade) - checksync - localdbcsvpre - emerge -uDaN --with-bdeps=y @system @world "$@" - updatelocaldb - ;; - auto-install) - redcoresync - localdbcsvpre - emerge "$@" - updatelocaldb - ;; - auto-uninstall) - redcoresync - localdbcsvpre - emerge --depclean "$@" - updatelocaldb - ;; - auto-force-uninstall) - redcoresync - localdbcsvpre - emerge --unmerge "$@" - updatelocaldb - ;; - auto-remove-orphans) - redcoresync - localdbcsvpre - emerge --depclean -q - updatelocaldb - ;; - auto-upgrade) - redcoresync - localdbcsvpre - emerge -uDN --with-bdeps=y @system @world "$@" - updatelocaldb - ;; - search) - emerge -s "$@" - ;; - update) - redcoresync - ;; - belongs) - equery belongs "$@" - ;; - depends) - equery depends "$@" - ;; - files) - equery files "$@" - ;; - sysinfo) - emerge --info - ;; - *) - cat <<-"EOH" - Usage: sisyphus command [package(s)] - - sisyphus is a simple wrapper around portage, gentoolkit, and portage-utils that provides an - apt-get/yum-alike interface to these commands, to assist people transitioning from - Debian/RedHat-based systems to Gentoo. - - Commands : - install - Install new packages - uninstall - Uninstall packages safely - force-uninstall - *Unsafely* uninstall packages - remove-orphans - Uninstall packages that are no longer needed - upgrade - Upgrade system - auto-install - Install new packages (no confirmation) - auto-uninstall - Uninstall packages safely (no confirmation) - auto-force-uninstall - *Unsafely* uninstall packages (no confirmation) - auto-remove-orphans - Uninstall packages that are no longer needed (no confirmation) - auto-upgrade - Upgrade system (no confirmation) - search - Search for packages - update - Resync portage tree, portage config && redcore overlay - belongs - List what package FILE(s) belong to - depends - List all packages directly depending on given package - files - List all files installed by package - sysinfo - Display information about installed core packages and portage configuration - EOH - ;; -esac diff --git a/frontend/cli/sisyphus-cli.py b/frontend/cli/sisyphus-cli.py deleted file mode 100755 index 3d4fb3a..0000000 --- a/frontend/cli/sisyphus-cli.py +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/python3 - -import sys -import subprocess -from libsisyphus import * - -check_if_srcmode() - -if "__main__" == __name__: - if "install" in sys.argv[1:]: - sisyphus_pkg_install() - elif "uninstall" in sys.argv[1:]: - sisyphus_pkg_uninstall() - elif "force-uninstall" in sys.argv[1:]: - sisyphus_pkg_force_uninstall() - elif "remove-orphans" in sys.argv[1:]: - sisyphus_pkg_remove_orphans() - elif "upgrade" in sys.argv[1:]: - sisyphus_pkg_system_upgrade() - elif "auto-install" in sys.argv[1:]: - sisyphus_pkg_auto_install() - elif "auto-uninstall" in sys.argv[1:]: - sisyphus_pkg_auto_uninstall() - elif "auto-force-uninstall" in sys.argv[1:]: - sisyphus_pkg_auto_force_uninstall() - elif "auto-remove-orphans" in sys.argv[1:]: - sisyphus_pkg_auto_remove_orphans() - elif "auto-upgrade" in sys.argv[1:]: - sisyphus_pkg_auto_system_upgrade() - elif "search" in sys.argv[1:]: - sisyphus_pkg_search() - elif "update" in sys.argv[1:]: - sisyphus_pkg_system_update() diff --git a/frontend/gui/Makefile b/frontend/gui/Makefile deleted file mode 100644 index 67236e1..0000000 --- a/frontend/gui/Makefile +++ /dev/null @@ -1,40 +0,0 @@ -SUBDIRS = -DESTDIR = -UBINDIR ?= /usr/bin -DESKTOPDIR ?= /usr/share/applications -PIXMAPDIR ?= /usr/share/pixmaps -SISYPHUSDATADIR ?= /usr/share/sisyphus-gui -POLKITDIR ?= /usr/share/polkit-1/actions - -all: - for d in $(SUBDIRS); do $(MAKE) -C $$d; done - -clean: - for d in $(SUBDIRS); do $(MAKE) -C $$d clean; done - -install: - for d in $(SUBDIRS); do $(MAKE) -C $$d install; done - - install -d $(DESTDIR)$(UBINDIR) - install -m 0755 sisyphus-gui $(DESTDIR)$(UBINDIR)/ - install -m 0755 sisyphus-gui-pkexec $(DESTDIR)$(UBINDIR)/ - install -d $(DESTDIR)$(SISYPHUSDATADIR) - install -d $(DESTDIR)$(SISYPHUSDATADIR)/icon - install -d $(DESTDIR)$(SISYPHUSDATADIR)/ui - install -m 0755 *.py $(DESTDIR)$(SISYPHUSDATADIR)/ - install -m 0755 icon/* $(DESTDIR)$(SISYPHUSDATADIR)/icon/ - install -m 0755 ui/* $(DESTDIR)$(SISYPHUSDATADIR)/ui/ - install -d $(DESTDIR)$(DESKTOPDIR) - install -m 0755 desktop/sisyphus-gui.desktop $(DESTDIR)$(DESKTOPDIR)/ - install -d $(DESTDIR)$(PIXMAPDIR) - install -m 0644 desktop/sisyphus-gui.png $(DESTDIR)$(PIXMAPDIR) - install -d $(DESTDIR)$(POLKITDIR) - install -m 0644 org.redcorelinux.sisyphus-gui.policy $(DESTDIR)$(POLKITDIR)/ - -uninstall: - rm -rf $(DESTDIR)$(UBINDIR)/sisyphus-gui - rm -rf $(DESTDIR)$(UBINDIR)/sisyphus-gui-pkexec - rm -rf $(DESTDIR)$(DESKTOPDIR)/sisyphus-gui.desktop - rm -rf $(DESTDIR)$(PIXMAPDIR)/sisyphus-gui.png - rm -rf $(DESTDIR)$(POLKITDIR)/org.redcorelinux.sisyphus-gui.policy - rm -rf $(DESTDIR)$(SISYPHUSDATADIR) diff --git a/frontend/gui/accesories.py b/frontend/gui/accesories.py deleted file mode 100755 index 32d3b68..0000000 --- a/frontend/gui/accesories.py +++ /dev/null @@ -1,50 +0,0 @@ -#!/usr/bin/python3 -import sys, subprocess, sqlite3 -from PyQt5 import QtCore, QtGui, QtWidgets, uic - -class Accesories(QtWidgets.QMainWindow): - def __init__(self): - super(Accesories, self).__init__() - uic.loadUi('ui/accesories.ui', self) - self.centerOnScreen() - self.show() - self.load_packages() - - self.package_install.clicked.connect(self.install_package) - self.package_uninstall.clicked.connect(self.uninstall_package) - self.orphans_remove.clicked.connect(self.remove_orphans) - self.category_exit.clicked.connect(self.exit_category) - - def centerOnScreen(self): - resolution = QtWidgets.QDesktopWidget().screenGeometry() - self.move((resolution.width() / 2) - (self.frameSize().width() / 2), - (resolution.height() / 2) - (self.frameSize().height() / 2)) - - def install_package(self): - pkgname = self.table_accesories.item(self.table_accesories.currentRow(), 1).text() - subprocess.Popen(['xterm', '-e', 'sisyphus', 'auto-install'] + pkgname.split()) - - def uninstall_package(self): - pkgname = self.table_accesories.item(self.table_accesories.currentRow(), 1).text() - subprocess.Popen(['xterm', '-e', 'sisyphus', 'auto-uninstall'] + pkgname.split()) - - def remove_orphans(self): - subprocess.Popen(['xterm', '-e', 'sisyphus', 'remove-orphans']) - - def exit_category(self): - self.close() - - def load_packages(self): - with sqlite3.connect('/var/lib/sisyphus/db/sisyphus.db') as db: - cursor=db.cursor() - cursor.execute('''SELECT * from remote_packages''') - rows = cursor.fetchall() - - for row in rows: - inx = rows.index(row) - self.table_accesories.insertRow(inx) - self.table_accesories.setItem(inx, 0, QtWidgets.QTableWidgetItem(row[0])) - self.table_accesories.setItem(inx, 1, QtWidgets.QTableWidgetItem(row[1])) - self.table_accesories.setItem(inx, 2, QtWidgets.QTableWidgetItem(row[2])) - self.table_accesories.setItem(inx, 3, QtWidgets.QTableWidgetItem(row[3])) - self.table_accesories.setItem(inx, 4, QtWidgets.QTableWidgetItem(row[4])) diff --git a/frontend/gui/desktop/sisyphus-gui.desktop b/frontend/gui/desktop/sisyphus-gui.desktop deleted file mode 100755 index c4ff12b..0000000 --- a/frontend/gui/desktop/sisyphus-gui.desktop +++ /dev/null @@ -1,7 +0,0 @@ -[Desktop Entry] -Name=Sisyphus GUI -Type=Application -Comment=Sisyphus Package Manager (GUI) -Exec=sisyphus-gui-pkexec -Icon=sisyphus-gui -Categories=System; diff --git a/frontend/gui/desktop/sisyphus-gui.png b/frontend/gui/desktop/sisyphus-gui.png deleted file mode 100644 index d36d93b..0000000 Binary files a/frontend/gui/desktop/sisyphus-gui.png and /dev/null differ diff --git a/frontend/gui/development.py b/frontend/gui/development.py deleted file mode 100755 index ede83a4..0000000 --- a/frontend/gui/development.py +++ /dev/null @@ -1,50 +0,0 @@ -#!/usr/bin/python3 -import sys, subprocess, sqlite3 -from PyQt5 import QtCore, QtGui, QtWidgets, uic - -class Development(QtWidgets.QMainWindow): - def __init__(self): - super(Development, self).__init__() - uic.loadUi('ui/development.ui', self) - self.centerOnScreen() - self.show() - self.load_packages() - - self.package_install.clicked.connect(self.install_package) - self.package_uninstall.clicked.connect(self.uninstall_package) - self.orphans_remove.clicked.connect(self.remove_orphans) - self.category_exit.clicked.connect(self.exit_category) - - def centerOnScreen(self): - resolution = QtWidgets.QDesktopWidget().screenGeometry() - self.move((resolution.width() / 2) - (self.frameSize().width() / 2), - (resolution.height() / 2) - (self.frameSize().height() / 2)) - - def install_package(self): - pkgname = self.table_development.item(self.table_development.currentRow(), 1).text() - subprocess.Popen(['xterm', '-e', 'sisyphus', 'auto-install'] + pkgname.split()) - - def uninstall_package(self): - pkgname = self.table_development.item(self.table_development.currentRow(), 1).text() - subprocess.Popen(['xterm', '-e', 'sisyphus', 'auto-uninstall'] + pkgname.split()) - - def remove_orphans(self): - subprocess.Popen(['xterm', '-e', 'sisyphus', 'auto-uninstall']) - - def exit_category(self): - self.close() - - def load_packages(self): - with sqlite3.connect('/var/lib/sisyphus/db/sisyphus.db') as db: - cursor=db.cursor() - cursor.execute('''SELECT * from remote_packages''') - rows = cursor.fetchall() - - for row in rows: - inx = rows.index(row) - self.table_development.insertRow(inx) - self.table_development.setItem(inx, 0, QtWidgets.QTableWidgetItem(row[0])) - self.table_development.setItem(inx, 1, QtWidgets.QTableWidgetItem(row[1])) - self.table_development.setItem(inx, 2, QtWidgets.QTableWidgetItem(row[2])) - self.table_development.setItem(inx, 3, QtWidgets.QTableWidgetItem(row[3])) - self.table_development.setItem(inx, 4, QtWidgets.QTableWidgetItem(row[4])) diff --git a/frontend/gui/everything.py b/frontend/gui/everything.py deleted file mode 100755 index ac83ca6..0000000 --- a/frontend/gui/everything.py +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/python3 -import sys, subprocess, sqlite3 -from PyQt5 import QtCore, QtGui, QtWidgets, uic - -class Everything(QtWidgets.QMainWindow): - def __init__(self): - super(Everything, self).__init__() - uic.loadUi('ui/everything.ui', self) - self.centerOnScreen() - self.show() - self.load_packages() - - self.package_install.clicked.connect(self.install_package) - self.package_uninstall.clicked.connect(self.uninstall_package) - self.orphans_remove.clicked.connect(self.remove_orphans) - self.category_exit.clicked.connect(self.exit_category) - - def centerOnScreen(self): - resolution = QtWidgets.QDesktopWidget().screenGeometry() - self.move((resolution.width() / 2) - (self.frameSize().width() / 2), - (resolution.height() / 2) - (self.frameSize().height() / 2)) - - def install_package(self): - pkgname = self.table_everything.item(self.table_everything.currentRow(), 1).text() - subprocess.Popen(['xterm', '-e', 'sisyphus', 'auto-install'] + pkgname.split()) - - def uninstall_package(self): - pkgname = self.table_everything.item(self.table_everything.currentRow(), 1).text() - subprocess.Popen(['xterm', '-e', 'sisyphus', 'auto-uninstall'] + pkgname.split()) - - def remove_orphans(self): - subprocess.Popen(['xterm', '-e', 'sisyphus', 'remove-orphans']) - - def exit_category(self): - self.close() - - def load_packages(self): - with sqlite3.connect('/var/lib/sisyphus/db/sisyphus.db') as db: - cursor=db.cursor() - cursor.execute('''SELECT - a.category AS cat, - a.name AS pn, - a.version AS av, - i.version AS iv, - a.description AS descr - 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 - ''') - rows = cursor.fetchall() - - for row in rows: - inx = rows.index(row) - self.table_everything.insertRow(inx) - self.table_everything.setItem(inx, 0, QtWidgets.QTableWidgetItem(row[0])) - self.table_everything.setItem(inx, 1, QtWidgets.QTableWidgetItem(row[1])) - self.table_everything.setItem(inx, 2, QtWidgets.QTableWidgetItem(row[2])) - self.table_everything.setItem(inx, 3, QtWidgets.QTableWidgetItem(row[3])) - self.table_everything.setItem(inx, 4, QtWidgets.QTableWidgetItem(row[4])) diff --git a/frontend/gui/games.py b/frontend/gui/games.py deleted file mode 100755 index 5eed9fa..0000000 --- a/frontend/gui/games.py +++ /dev/null @@ -1,77 +0,0 @@ -#!/usr/bin/python3 -import sys, subprocess, sqlite3 -from PyQt5 import QtCore, QtGui, QtWidgets, uic - -class Games(QtWidgets.QMainWindow): - def __init__(self): - super(Games, self).__init__() - uic.loadUi('ui/games.ui', self) - self.centerOnScreen() - self.show() - self.load_packages() - - self.package_install.clicked.connect(self.install_package) - self.package_uninstall.clicked.connect(self.uninstall_package) - self.orphans_remove.clicked.connect(self.remove_orphans) - self.category_exit.clicked.connect(self.exit_category) - - def centerOnScreen(self): - resolution = QtWidgets.QDesktopWidget().screenGeometry() - self.move((resolution.width() / 2) - (self.frameSize().width() / 2), - (resolution.height() / 2) - (self.frameSize().height() / 2)) - - def install_package(self): - pkgname = self.table_games.item(self.table_games.currentRow(), 1).text() - subprocess.Popen(['xterm', '-e', 'sisyphus', 'auto-install'] + pkgname.split()) - - def uninstall_package(self): - pkgname = self.table_games.item(self.table_games.currentRow(), 1).text() - subprocess.Popen(['xterm', '-e', 'sisyphus', 'auto-uninstall'] + pkgname.split()) - - def remove_orphans(self): - subprocess.Popen(['xterm', '-e', 'sisyphus', 'remove-orphans']) - - def exit_category(self): - self.close() - - def load_packages(self): - with sqlite3.connect('/var/lib/sisyphus/db/sisyphus.db') as db: - cursor=db.cursor() - cursor.execute('''SELECT - a.category AS cat, - a.name AS pn, - a.version AS av, - i.version AS iv, - a.description AS descr - 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 a.name IN - ('steam', - 'playonlinux', - 'armagetronad', - 'chromium-bsu', - 'supertuxkart', - 'teeworlds', - 'dosbox', - 'snes9x', - 'zsnes', - 'urbanterror', - 'openttd', - '0ad', - 'warzone2100', - 'wesnoth', - 'xonotic') - ''') - rows = cursor.fetchall() - - for row in rows: - inx = rows.index(row) - self.table_games.insertRow(inx) - self.table_games.setItem(inx, 0, QtWidgets.QTableWidgetItem(row[0])) - self.table_games.setItem(inx, 1, QtWidgets.QTableWidgetItem(row[1])) - self.table_games.setItem(inx, 2, QtWidgets.QTableWidgetItem(row[2])) - self.table_games.setItem(inx, 3, QtWidgets.QTableWidgetItem(row[3])) - self.table_games.setItem(inx, 4, QtWidgets.QTableWidgetItem(row[4])) diff --git a/frontend/gui/graphics.py b/frontend/gui/graphics.py deleted file mode 100755 index a50a169..0000000 --- a/frontend/gui/graphics.py +++ /dev/null @@ -1,50 +0,0 @@ -#!/usr/bin/python3 -import sys, subprocess, sqlite3 -from PyQt5 import QtCore, QtGui, QtWidgets, uic - -class Graphics(QtWidgets.QMainWindow): - def __init__(self): - super(Graphics, self).__init__() - uic.loadUi('ui/graphics.ui', self) - self.centerOnScreen() - self.show() - self.load_packages() - - self.package_install.clicked.connect(self.install_package) - self.package_uninstall.clicked.connect(self.uninstall_package) - self.orphans_remove.clicked.connect(self.remove_orphans) - self.category_exit.clicked.connect(self.exit_category) - - def centerOnScreen(self): - resolution = QtWidgets.QDesktopWidget().screenGeometry() - self.move((resolution.width() / 2) - (self.frameSize().width() / 2), - (resolution.height() / 2) - (self.frameSize().height() / 2)) - - def install_package(self): - pkgname = self.table_graphics.item(self.table_graphics.currentRow(), 1).text() - subprocess.Popen(['xterm', '-e', 'sisyphus', 'auto-install'] + pkgname.split()) - - def uninstall_package(self): - pkgname = self.table_graphics.item(self.table_graphics.currentRow(), 1).text() - subprocess.Popen(['xterm', '-e', 'sisyphus', 'auto-uninstall'] + pkgname.split()) - - def remove_orphans(self): - subprocess.Popen(['xterm', '-e', 'sisyphus', 'remove-orphans']) - - def exit_category(self): - self.close() - - def load_packages(self): - with sqlite3.connect('/var/lib/sisyphus/db/sisyphus.db') as db: - cursor=db.cursor() - cursor.execute('''SELECT * from remote_packages''') - rows = cursor.fetchall() - - for row in rows: - inx = rows.index(row) - self.table_graphics.insertRow(inx) - self.table_graphics.setItem(inx, 0, QtWidgets.QTableWidgetItem(row[0])) - self.table_graphics.setItem(inx, 1, QtWidgets.QTableWidgetItem(row[1])) - self.table_graphics.setItem(inx, 2, QtWidgets.QTableWidgetItem(row[2])) - self.table_graphics.setItem(inx, 3, QtWidgets.QTableWidgetItem(row[3])) - self.table_graphics.setItem(inx, 4, QtWidgets.QTableWidgetItem(row[4])) diff --git a/frontend/gui/icon/category_accessories.png b/frontend/gui/icon/category_accessories.png deleted file mode 100644 index becbfc9..0000000 Binary files a/frontend/gui/icon/category_accessories.png and /dev/null differ diff --git a/frontend/gui/icon/category_all.png b/frontend/gui/icon/category_all.png deleted file mode 100644 index 462c97c..0000000 Binary files a/frontend/gui/icon/category_all.png and /dev/null differ diff --git a/frontend/gui/icon/category_development.png b/frontend/gui/icon/category_development.png deleted file mode 100644 index b2c160e..0000000 Binary files a/frontend/gui/icon/category_development.png and /dev/null differ diff --git a/frontend/gui/icon/category_games.png b/frontend/gui/icon/category_games.png deleted file mode 100644 index b128490..0000000 Binary files a/frontend/gui/icon/category_games.png and /dev/null differ diff --git a/frontend/gui/icon/category_graphics.png b/frontend/gui/icon/category_graphics.png deleted file mode 100644 index 63c7c5e..0000000 Binary files a/frontend/gui/icon/category_graphics.png and /dev/null differ diff --git a/frontend/gui/icon/category_internet.png b/frontend/gui/icon/category_internet.png deleted file mode 100644 index 9f630cd..0000000 Binary files a/frontend/gui/icon/category_internet.png and /dev/null differ diff --git a/frontend/gui/icon/category_local.png b/frontend/gui/icon/category_local.png deleted file mode 100644 index 561d218..0000000 Binary files a/frontend/gui/icon/category_local.png and /dev/null differ diff --git a/frontend/gui/icon/category_multimedia.png b/frontend/gui/icon/category_multimedia.png deleted file mode 100644 index e6414e6..0000000 Binary files a/frontend/gui/icon/category_multimedia.png and /dev/null differ diff --git a/frontend/gui/icon/category_office.png b/frontend/gui/icon/category_office.png deleted file mode 100644 index 78af8a4..0000000 Binary files a/frontend/gui/icon/category_office.png and /dev/null differ diff --git a/frontend/gui/icon/category_system.png b/frontend/gui/icon/category_system.png deleted file mode 100644 index 2a360bd..0000000 Binary files a/frontend/gui/icon/category_system.png and /dev/null differ diff --git a/frontend/gui/icon/package_install.png b/frontend/gui/icon/package_install.png deleted file mode 100644 index 736cddf..0000000 Binary files a/frontend/gui/icon/package_install.png and /dev/null differ diff --git a/frontend/gui/icon/package_search.png b/frontend/gui/icon/package_search.png deleted file mode 100644 index 5f50a53..0000000 Binary files a/frontend/gui/icon/package_search.png and /dev/null differ diff --git a/frontend/gui/icon/package_uninstall.png b/frontend/gui/icon/package_uninstall.png deleted file mode 100644 index 187ce04..0000000 Binary files a/frontend/gui/icon/package_uninstall.png and /dev/null differ diff --git a/frontend/gui/icon/remove_orphans.png b/frontend/gui/icon/remove_orphans.png deleted file mode 100644 index b165bf7..0000000 Binary files a/frontend/gui/icon/remove_orphans.png and /dev/null differ diff --git a/frontend/gui/icon/system_upgrade.png b/frontend/gui/icon/system_upgrade.png deleted file mode 100644 index 4443cb7..0000000 Binary files a/frontend/gui/icon/system_upgrade.png and /dev/null differ diff --git a/frontend/gui/icon/window_close.png b/frontend/gui/icon/window_close.png deleted file mode 100644 index 35dbf35..0000000 Binary files a/frontend/gui/icon/window_close.png and /dev/null differ diff --git a/frontend/gui/icon/window_icon.png b/frontend/gui/icon/window_icon.png deleted file mode 100644 index da169ba..0000000 Binary files a/frontend/gui/icon/window_icon.png and /dev/null differ diff --git a/frontend/gui/internet.py b/frontend/gui/internet.py deleted file mode 100755 index e8ad1d3..0000000 --- a/frontend/gui/internet.py +++ /dev/null @@ -1,100 +0,0 @@ -#!/usr/bin/python3 -import sys, subprocess, sqlite3 -from PyQt5 import QtCore, QtGui, QtWidgets, uic - -class Internet(QtWidgets.QMainWindow): - def __init__(self): - super(Internet, self).__init__() - uic.loadUi('ui/internet.ui', self) - self.centerOnScreen() - self.show() - self.load_packages() - - self.package_install.clicked.connect(self.install_package) - self.package_uninstall.clicked.connect(self.uninstall_package) - self.orphans_remove.clicked.connect(self.remove_orphans) - self.category_exit.clicked.connect(self.exit_category) - - def centerOnScreen(self): - resolution = QtWidgets.QDesktopWidget().screenGeometry() - self.move((resolution.width() / 2) - (self.frameSize().width() / 2), - (resolution.height() / 2) - (self.frameSize().height() / 2)) - - def install_package(self): - pkgname = self.table_internet.item(self.table_internet.currentRow(), 1).text() - subprocess.Popen(['xterm', '-e', 'sisyphus', 'auto-install'] + pkgname.split()) - - def uninstall_package(self): - pkgname = self.table_internet.item(self.table_internet.currentRow(), 1).text() - subprocess.Popen(['xterm', '-e', 'sisyphus', 'auto-uninstall'] + pkgname.split()) - - def remove_orphans(self): - subprocess.Popen(['xterm', '-e', 'sisyphus', 'remove-orphans']) - - def exit_category(self): - self.close() - - def load_packages(self): - with sqlite3.connect('/var/lib/sisyphus/db/sisyphus.db') as db: - cursor=db.cursor() - cursor.execute('''SELECT - a.category AS cat, - a.name AS pn, - a.version AS av, - i.version AS iv, - a.description AS descr - 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 a.name IN - ('firewalld', - 'ufw', - 'ufw-frontends', - 'cifs-utils', - 'samba', - 'sshfs', - 'filezilla', - 'franz', - 'qtox', - 'telegram', - 'viber', - 'konversation', - 'quassel', - 'aria2', - 'dropbox', - 'megasync', - 'owncloud-client', - 'teamviewer', - 'telnet-bsd', - 'tigervnc', - 'youtube-dl', - 'quiterss', - 'qbittorrent', - 'transmission', - 'firefox', - 'google-chrome', - 'opera', - 'qupzilla', - 'vivaldi', - 'adobe-flash', - 'chrome-binary-plugins', - 'freshplayerplugin', - 'google-talkplugin', - 'wmail', - 'trojita', - 'aircrack-ng', - 'wavemon', - 'messengerfordesktop') - ''') - rows = cursor.fetchall() - - for row in rows: - inx = rows.index(row) - self.table_internet.insertRow(inx) - self.table_internet.setItem(inx, 0, QtWidgets.QTableWidgetItem(row[0])) - self.table_internet.setItem(inx, 1, QtWidgets.QTableWidgetItem(row[1])) - self.table_internet.setItem(inx, 2, QtWidgets.QTableWidgetItem(row[2])) - self.table_internet.setItem(inx, 3, QtWidgets.QTableWidgetItem(row[3])) - self.table_internet.setItem(inx, 4, QtWidgets.QTableWidgetItem(row[4])) diff --git a/frontend/gui/local.py b/frontend/gui/local.py deleted file mode 100755 index e8b506a..0000000 --- a/frontend/gui/local.py +++ /dev/null @@ -1,50 +0,0 @@ -#!/usr/bin/python3 -import sys, subprocess, sqlite3 -from PyQt5 import QtCore, QtGui, QtWidgets, uic - -class Local(QtWidgets.QMainWindow): - def __init__(self): - super(Local, self).__init__() - uic.loadUi('ui/local.ui', self) - self.centerOnScreen() - self.show() - self.load_packages() - - self.package_install.clicked.connect(self.install_package) - self.package_uninstall.clicked.connect(self.uninstall_package) - self.orphans_remove.clicked.connect(self.remove_orphans) - self.category_exit.clicked.connect(self.exit_category) - - def centerOnScreen(self): - resolution = QtWidgets.QDesktopWidget().screenGeometry() - self.move((resolution.width() / 2) - (self.frameSize().width() / 2), - (resolution.height() / 2) - (self.frameSize().height() / 2)) - - def install_package(self): - pkgname = self.table_local.item(self.table_local.currentRow(), 1).text() - subprocess.Popen(['xterm', '-e', 'sisyphus', 'auto-install'] + pkgname.split()) - - def uninstall_package(self): - pkgname = self.table_local.item(self.table_local.currentRow(), 1).text() - subprocess.Popen(['xterm', '-e', 'sisyphus', 'auto-uninstall'] + pkgname.split()) - - def remove_orphans(self): - subprocess.Popen(['xterm', '-e', 'sisyphus', 'remove-orphans']) - - def exit_category(self): - self.close() - - def load_packages(self): - with sqlite3.connect('/var/lib/sisyphus/db/sisyphus.db') as db: - cursor=db.cursor() - cursor.execute('''SELECT * from local_packages''') - rows = cursor.fetchall() - - for row in rows: - inx = rows.index(row) - self.table_local.insertRow(inx) - self.table_local.setItem(inx, 0, QtWidgets.QTableWidgetItem(row[0])) - self.table_local.setItem(inx, 1, QtWidgets.QTableWidgetItem(row[1])) - self.table_local.setItem(inx, 2, QtWidgets.QTableWidgetItem(row[2])) - self.table_local.setItem(inx, 3, QtWidgets.QTableWidgetItem(row[3])) - self.table_local.setItem(inx, 4, QtWidgets.QTableWidgetItem(row[4])) diff --git a/frontend/gui/multimedia.py b/frontend/gui/multimedia.py deleted file mode 100755 index e4214f2..0000000 --- a/frontend/gui/multimedia.py +++ /dev/null @@ -1,50 +0,0 @@ -#!/usr/bin/python3 -import sys, subprocess, sqlite3 -from PyQt5 import QtCore, QtGui, QtWidgets, uic - -class Multimedia(QtWidgets.QMainWindow): - def __init__(self): - super(Multimedia, self).__init__() - uic.loadUi('ui/multimedia.ui', self) - self.centerOnScreen() - self.show() - self.load_packages() - - self.package_install.clicked.connect(self.install_package) - self.package_uninstall.clicked.connect(self.uninstall_package) - self.orphans_remove.clicked.connect(self.remove_orphans) - self.category_exit.clicked.connect(self.exit_category) - - def centerOnScreen(self): - resolution = QtWidgets.QDesktopWidget().screenGeometry() - self.move((resolution.width() / 2) - (self.frameSize().width() / 2), - (resolution.height() / 2) - (self.frameSize().height() / 2)) - - def install_package(self): - pkgname = self.table_multimedia.item(self.table_multimedia.currentRow(), 1).text() - subprocess.Popen(['xterm', '-e', 'sisyphus', 'auto-install'] + pkgname.split()) - - def uninstall_package(self): - pkgname = self.table_multimedia.item(self.table_multimedia.currentRow(), 1).text() - subprocess.Popen(['xterm', '-e', 'sisyphus', 'auto-uninstall'] + pkgname.split()) - - def remove_orphans(self): - subprocess.Popen(['xterm', '-e', 'sisyphus', 'remove-orphans']) - - def exit_category(self): - self.close() - - def load_packages(self): - with sqlite3.connect('/var/lib/sisyphus/db/sisyphus.db') as db: - cursor=db.cursor() - cursor.execute('''SELECT * from remote_packages''') - rows = cursor.fetchall() - - for row in rows: - inx = rows.index(row) - self.table_multimedia.insertRow(inx) - self.table_multimedia.setItem(inx, 0, QtWidgets.QTableWidgetItem(row[0])) - self.table_multimedia.setItem(inx, 1, QtWidgets.QTableWidgetItem(row[1])) - self.table_multimedia.setItem(inx, 2, QtWidgets.QTableWidgetItem(row[2])) - self.table_multimedia.setItem(inx, 3, QtWidgets.QTableWidgetItem(row[3])) - self.table_multimedia.setItem(inx, 4, QtWidgets.QTableWidgetItem(row[4])) diff --git a/frontend/gui/office.py b/frontend/gui/office.py deleted file mode 100755 index 286494a..0000000 --- a/frontend/gui/office.py +++ /dev/null @@ -1,84 +0,0 @@ -#!/usr/bin/python3 -import sys, subprocess, sqlite3 -from PyQt5 import QtCore, QtGui, QtWidgets, uic - -class Office(QtWidgets.QMainWindow): - def __init__(self): - super(Office, self).__init__() - uic.loadUi('ui/office.ui', self) - self.centerOnScreen() - self.show() - self.load_packages() - - self.package_install.clicked.connect(self.install_package) - self.package_uninstall.clicked.connect(self.uninstall_package) - self.orphans_remove.clicked.connect(self.remove_orphans) - self.category_exit.clicked.connect(self.exit_category) - - def centerOnScreen(self): - resolution = QtWidgets.QDesktopWidget().screenGeometry() - self.move((resolution.width() / 2) - (self.frameSize().width() / 2), - (resolution.height() / 2) - (self.frameSize().height() / 2)) - - def install_package(self): - pkgname = self.table_office.item(self.table_office.currentRow(), 1).text() - subprocess.Popen(['xterm', '-e', 'sisyphus', 'auto-install'] + pkgname.split()) - - def uninstall_package(self): - pkgname = self.table_office.item(self.table_office.currentRow(), 1).text() - subprocess.Popen(['xterm', '-e', 'sisyphus', 'auto-uninstall'] + pkgname.split()) - - def remove_orphans(self): - subprocess.Popen(['xterm', '-e', 'sisyphus', 'remove-orphans']) - - def exit_category(self): - self.close() - - def load_packages(self): - with sqlite3.connect('/var/lib/sisyphus/db/sisyphus.db') as db: - cursor=db.cursor() - cursor.execute('''SELECT - a.category AS cat, - a.name AS pn, - a.version AS av, - i.version AS iv, - a.description AS descr - 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 a.name IN - ('fet', - 'libreoffice', - 'wps-office', - 'tesseract', - 'okular', - 'cantarell', - 'corefonts', - 'dejavu', - 'liberation-fonts', - 'libertine', - 'noto', - 'open-sans', - 'roboto', - 'ttf-bitstream-vera', - 'qpdfview', - 'cups', - 'cups-filters', - 'cups-pdf', - 'simple-scan', - 'cnijfilter', - 'cnijfilter-drivers', - 'hplip') - ''') - rows = cursor.fetchall() - - for row in rows: - inx = rows.index(row) - self.table_office.insertRow(inx) - self.table_office.setItem(inx, 0, QtWidgets.QTableWidgetItem(row[0])) - self.table_office.setItem(inx, 1, QtWidgets.QTableWidgetItem(row[1])) - self.table_office.setItem(inx, 2, QtWidgets.QTableWidgetItem(row[2])) - self.table_office.setItem(inx, 3, QtWidgets.QTableWidgetItem(row[3])) - self.table_office.setItem(inx, 4, QtWidgets.QTableWidgetItem(row[4])) diff --git a/frontend/gui/org.redcorelinux.sisyphus-gui.policy b/frontend/gui/org.redcorelinux.sisyphus-gui.policy deleted file mode 100644 index 811c348..0000000 --- a/frontend/gui/org.redcorelinux.sisyphus-gui.policy +++ /dev/null @@ -1,22 +0,0 @@ - - - - - Redcore Linux - http://redcorelinux.org - - - Run Sisyphus - Authentication is required to run Sisyphus - redcore-logo - - no - no - auth_admin - - /usr/bin/sisyphus-gui - true - - diff --git a/frontend/gui/sisyphus-gui b/frontend/gui/sisyphus-gui deleted file mode 100755 index 1e29d08..0000000 --- a/frontend/gui/sisyphus-gui +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env bash - -# Sisyphus is a simple GUI for sisyphus, the portage wrapper -# Main Author : Ghiunhan Mamut @ Redcore Linux Project - -main() { - pushd /usr/share/sisyphus-gui - python3 sisyphus-gui.py - popd -} - -main diff --git a/frontend/gui/sisyphus-gui-pkexec b/frontend/gui/sisyphus-gui-pkexec deleted file mode 100755 index 4a1b496..0000000 --- a/frontend/gui/sisyphus-gui-pkexec +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/env bash -pkexec /usr/bin/sisyphus-gui diff --git a/frontend/gui/sisyphus-gui.py b/frontend/gui/sisyphus-gui.py deleted file mode 100755 index 1cc4fb6..0000000 --- a/frontend/gui/sisyphus-gui.py +++ /dev/null @@ -1,106 +0,0 @@ -#!/usr/bin/python3 -import sys, subprocess -from PyQt5 import QtCore, QtGui, QtWidgets, uic - -from accesories import Accesories -from development import Development -from games import Games -from graphics import Graphics -from internet import Internet -from multimedia import Multimedia -from office import Office -from system import System -from local import Local -from everything import Everything - -class Sisyphus(QtWidgets.QMainWindow): - def __init__(self): - super(Sisyphus, self).__init__() - uic.loadUi('ui/sisyphus-gui.ui', self) - self.centerOnScreen() - self.show() - - self.package_search.clicked.connect(self.search_package) - self.package_install.clicked.connect(self.install_package) - self.package_uninstall.clicked.connect(self.uninstall_package) - self.system_upgrade.clicked.connect(self.upgrade_system) - self.orphans_remove.clicked.connect(self.remove_orphans) - - self.category_accesories.clicked.connect(self.accesories_category) - self.category_development.clicked.connect(self.development_category) - self.category_games.clicked.connect(self.games_category) - self.category_graphics.clicked.connect(self.graphics_category) - self.category_internet.clicked.connect(self.internet_category) - self.category_multimedia.clicked.connect(self.multimedia_category) - self.category_office.clicked.connect(self.office_category) - self.category_system.clicked.connect(self.system_category) - self.category_local.clicked.connect(self.local_category) - self.category_everything.clicked.connect(self.everything_category) - - def centerOnScreen (self): - resolution = QtWidgets.QDesktopWidget().screenGeometry() - self.move((resolution.width() / 2) - (self.frameSize().width() / 2), - (resolution.height() / 2) - (self.frameSize().height() / 2)) - - def search_package(self): - pkgname = self.input.text() - subprocess.Popen(['xterm', '-hold', '-e', 'sisyphus', 'search'] + pkgname.split()) - - def install_package(self): - pkgname = self.input.text() - subprocess.Popen(['xterm', '-e', 'sisyphus', 'auto-install'] + pkgname.split()) - - def uninstall_package(self): - pkgname = self.input.text() - subprocess.Popen(['xterm', '-e', 'sisyphus', 'auto-uninstall'] + pkgname.split()) - - def upgrade_system(self): - subprocess.Popen(['xterm', '-e', 'sisyphus', 'autoupgrade']) - - def remove_orphans(self): - subprocess.Popen(['xterm', '-e', 'sisyphus', 'remove-orphans']) - - def accesories_category(self): - self.window = Accesories() - self.window.show() - - def development_category(self): - self.window = Development() - self.window.show() - - def games_category(self): - self.window = Games() - self.window.show() - - def graphics_category(self): - self.window = Graphics() - self.window.show() - - def internet_category(self): - self.window = Internet() - self.window.show() - - def multimedia_category(self): - self.window = Multimedia() - self.window.show() - - def office_category(self): - self.window = Office() - self.window.show() - - def system_category(self): - self.window = System() - self.window.show() - - def local_category(self): - self.window = Local() - self.window.show() - - def everything_category(self): - self.window = Everything() - self.window.show() - -if __name__ == '__main__': - app = QtWidgets.QApplication(sys.argv) - window = Sisyphus() - sys.exit(app.exec_()) diff --git a/frontend/gui/system.py b/frontend/gui/system.py deleted file mode 100755 index f8cc428..0000000 --- a/frontend/gui/system.py +++ /dev/null @@ -1,50 +0,0 @@ -#!/usr/bin/python3 -import sys, subprocess, sqlite3 -from PyQt5 import QtCore, QtGui, QtWidgets, uic - -class System(QtWidgets.QMainWindow): - def __init__(self): - super(System, self).__init__() - uic.loadUi('ui/system.ui', self) - self.centerOnScreen() - self.show() - self.load_packages() - - self.package_install.clicked.connect(self.install_package) - self.package_uninstall.clicked.connect(self.uninstall_package) - self.orphans_remove.clicked.connect(self.remove_orphans) - self.category_exit.clicked.connect(self.exit_category) - - def centerOnScreen(self): - resolution = QtWidgets.QDesktopWidget().screenGeometry() - self.move((resolution.width() / 2) - (self.frameSize().width() / 2), - (resolution.height() / 2) - (self.frameSize().height() / 2)) - - def install_package(self): - pkgname = self.table_system.item(self.table_system.currentRow(), 1).text() - subprocess.Popen(['xterm', '-e', 'sisyphus', 'auto-install'] + pkgname.split()) - - def uninstall_package(self): - pkgname = self.table_system.item(self.table_system.currentRow(), 1).text() - subprocess.Popen(['xterm', '-e', 'sisyphus', 'auto-uninstall'] + pkgname.split()) - - def remove_orphans(self): - subprocess.Popen(['xterm', '-e', 'sisyphus', 'remove-orphans']) - - def exit_category(self): - self.close() - - def load_packages(self): - with sqlite3.connect('/var/lib/sisyphus/db/sisyphus.db') as db: - cursor=db.cursor() - cursor.execute('''SELECT * from remote_packages''') - rows = cursor.fetchall() - - for row in rows: - inx = rows.index(row) - self.table_system.insertRow(inx) - self.table_system.setItem(inx, 0, QtWidgets.QTableWidgetItem(row[0])) - self.table_system.setItem(inx, 1, QtWidgets.QTableWidgetItem(row[1])) - self.table_system.setItem(inx, 2, QtWidgets.QTableWidgetItem(row[2])) - self.table_system.setItem(inx, 3, QtWidgets.QTableWidgetItem(row[3])) - self.table_system.setItem(inx, 4, QtWidgets.QTableWidgetItem(row[4])) diff --git a/frontend/gui/ui/accesories.ui b/frontend/gui/ui/accesories.ui deleted file mode 100644 index ea9e495..0000000 --- a/frontend/gui/ui/accesories.ui +++ /dev/null @@ -1,220 +0,0 @@ - - - Accesories - - - Qt::ApplicationModal - - - - 0 - 0 - 1000 - 600 - - - - - 0 - 0 - - - - - 1000 - 600 - - - - Sisyphus : Category Accesories - - - - ../icon/category_accessories.png../icon/category_accessories.png - - - - - 25 - 25 - 950 - 475 - - - - - 950 - 500 - - - - QFrame::Panel - - - QFrame::Raised - - - QAbstractScrollArea::AdjustToContents - - - QAbstractItemView::NoEditTriggers - - - false - - - QAbstractItemView::SingleSelection - - - QAbstractItemView::SelectRows - - - true - - - 110 - - - true - - - false - - - - Category - - - - - Name - - - - - Available Version - - - - - Installed Version - - - - - Description - - - - - - - 275 - 530 - 200 - 40 - - - - <html><head/><body><p align="center">Uninstall package</p></body></html> - - - - - - - ../icon/package_uninstall.png../icon/package_uninstall.png - - - - 32 - 32 - - - - - - - 525 - 530 - 200 - 40 - - - - <html><head/><body><p align="center">Remove orphan packages</p></body></html> - - - - - - - ../icon/remove_orphans.png../icon/remove_orphans.png - - - - 32 - 32 - - - - - - - 775 - 530 - 200 - 40 - - - - <html><head/><body><p align="center">Close window</p></body></html> - - - - ../icon/window_close.png../icon/window_close.png - - - - 32 - 32 - - - - - - - 25 - 530 - 200 - 40 - - - - <html><head/><body><p align="center">Install package</p></body></html> - - - - - - - ../icon/package_install.png../icon/package_install.png - - - - 32 - 32 - - - - - - table_accesories - package_install - package_uninstall - orphans_remove - category_exit - - - - diff --git a/frontend/gui/ui/development.ui b/frontend/gui/ui/development.ui deleted file mode 100644 index 4c102f1..0000000 --- a/frontend/gui/ui/development.ui +++ /dev/null @@ -1,220 +0,0 @@ - - - Development - - - Qt::ApplicationModal - - - - 0 - 0 - 1000 - 600 - - - - - 0 - 0 - - - - - 1000 - 600 - - - - Sisyphus : Category Development - - - - ../icon/category_development.png../icon/category_development.png - - - - - 25 - 25 - 950 - 475 - - - - - 950 - 500 - - - - QFrame::Panel - - - QFrame::Raised - - - QAbstractScrollArea::AdjustToContents - - - QAbstractItemView::NoEditTriggers - - - false - - - QAbstractItemView::SingleSelection - - - QAbstractItemView::SelectRows - - - true - - - 110 - - - true - - - false - - - - Category - - - - - Name - - - - - Available Version - - - - - Installed Version - - - - - Description - - - - - - - 275 - 530 - 200 - 40 - - - - <html><head/><body><p align="center">Uninstall package</p></body></html> - - - - - - - ../icon/package_uninstall.png../icon/package_uninstall.png - - - - 32 - 32 - - - - - - - 525 - 530 - 200 - 40 - - - - <html><head/><body><p align="center">Remove orphan packages</p></body></html> - - - - - - - ../icon/remove_orphans.png../icon/remove_orphans.png - - - - 32 - 32 - - - - - - - 775 - 530 - 200 - 40 - - - - <html><head/><body><p align="center">Close window</p></body></html> - - - - ../icon/window_close.png../icon/window_close.png - - - - 32 - 32 - - - - - - - 25 - 530 - 200 - 40 - - - - <html><head/><body><p align="center">Install package</p></body></html> - - - - - - - ../icon/package_install.png../icon/package_install.png - - - - 32 - 32 - - - - - - table_development - package_install - package_uninstall - orphans_remove - category_exit - - - - diff --git a/frontend/gui/ui/everything.ui b/frontend/gui/ui/everything.ui deleted file mode 100644 index b609cee..0000000 --- a/frontend/gui/ui/everything.ui +++ /dev/null @@ -1,220 +0,0 @@ - - - Everything - - - Qt::ApplicationModal - - - - 0 - 0 - 1000 - 600 - - - - - 0 - 0 - - - - - 1000 - 600 - - - - Sisyphus : All Packages - - - - ../icon/category_all.png../icon/category_all.png - - - - - 25 - 25 - 950 - 475 - - - - - 950 - 500 - - - - QFrame::Panel - - - QFrame::Raised - - - QAbstractScrollArea::AdjustToContents - - - QAbstractItemView::NoEditTriggers - - - false - - - QAbstractItemView::SingleSelection - - - QAbstractItemView::SelectRows - - - true - - - 110 - - - true - - - false - - - - Category - - - - - Name - - - - - Available Version - - - - - Installed Version - - - - - Description - - - - - - - 275 - 530 - 200 - 40 - - - - <html><head/><body><p align="center">Uninstall package</p></body></html> - - - - - - - ../icon/package_uninstall.png../icon/package_uninstall.png - - - - 32 - 32 - - - - - - - 525 - 530 - 200 - 40 - - - - <html><head/><body><p align="center">Remove orphan packages</p></body></html> - - - - - - - ../icon/remove_orphans.png../icon/remove_orphans.png - - - - 32 - 32 - - - - - - - 775 - 530 - 200 - 40 - - - - <html><head/><body><p align="center">Close window</p></body></html> - - - - ../icon/window_close.png../icon/window_close.png - - - - 32 - 32 - - - - - - - 25 - 530 - 200 - 40 - - - - <html><head/><body><p align="center">Install package</p></body></html> - - - - - - - ../icon/package_install.png../icon/package_install.png - - - - 32 - 32 - - - - - - table_everything - package_install - package_uninstall - orphans_remove - category_exit - - - - diff --git a/frontend/gui/ui/games.ui b/frontend/gui/ui/games.ui deleted file mode 100644 index 0bbc787..0000000 --- a/frontend/gui/ui/games.ui +++ /dev/null @@ -1,220 +0,0 @@ - - - Games - - - Qt::ApplicationModal - - - - 0 - 0 - 1000 - 600 - - - - - 0 - 0 - - - - - 1000 - 600 - - - - Sisyphus : Category Games - - - - ../icon/category_games.png../icon/category_games.png - - - - - 25 - 25 - 950 - 475 - - - - - 950 - 500 - - - - QFrame::Panel - - - QFrame::Raised - - - QAbstractScrollArea::AdjustToContents - - - QAbstractItemView::NoEditTriggers - - - false - - - QAbstractItemView::SingleSelection - - - QAbstractItemView::SelectRows - - - true - - - 110 - - - true - - - false - - - - Category - - - - - Name - - - - - Available Version - - - - - Installed Version - - - - - Description - - - - - - - 275 - 530 - 200 - 40 - - - - <html><head/><body><p align="center">Uninstall package</p></body></html> - - - - - - - ../icon/package_uninstall.png../icon/package_uninstall.png - - - - 32 - 32 - - - - - - - 525 - 530 - 200 - 40 - - - - <html><head/><body><p align="center">Remove orphan packages</p></body></html> - - - - - - - ../icon/remove_orphans.png../icon/remove_orphans.png - - - - 32 - 32 - - - - - - - 775 - 530 - 200 - 40 - - - - <html><head/><body><p align="center">Close window</p></body></html> - - - - ../icon/window_close.png../icon/window_close.png - - - - 32 - 32 - - - - - - - 25 - 530 - 200 - 40 - - - - <html><head/><body><p align="center">Install package</p></body></html> - - - - - - - ../icon/package_install.png../icon/package_install.png - - - - 32 - 32 - - - - - - table_games - package_install - package_uninstall - orphans_remove - category_exit - - - - diff --git a/frontend/gui/ui/graphics.ui b/frontend/gui/ui/graphics.ui deleted file mode 100644 index e943b49..0000000 --- a/frontend/gui/ui/graphics.ui +++ /dev/null @@ -1,220 +0,0 @@ - - - Graphics - - - Qt::ApplicationModal - - - - 0 - 0 - 1000 - 600 - - - - - 0 - 0 - - - - - 1000 - 600 - - - - Sisyphus : Category Graphics - - - - ../icon/category_graphics.png../icon/category_graphics.png - - - - - 25 - 25 - 950 - 475 - - - - - 950 - 500 - - - - QFrame::Panel - - - QFrame::Raised - - - QAbstractScrollArea::AdjustToContents - - - QAbstractItemView::NoEditTriggers - - - false - - - QAbstractItemView::SingleSelection - - - QAbstractItemView::SelectRows - - - true - - - 110 - - - true - - - false - - - - Category - - - - - Name - - - - - Available Version - - - - - Installed Version - - - - - Description - - - - - - - 275 - 530 - 200 - 40 - - - - <html><head/><body><p align="center">Uninstall package</p></body></html> - - - - - - - ../icon/package_uninstall.png../icon/package_uninstall.png - - - - 32 - 32 - - - - - - - 525 - 530 - 200 - 40 - - - - <html><head/><body><p align="center">Remove orphan packages</p></body></html> - - - - - - - ../icon/remove_orphans.png../icon/remove_orphans.png - - - - 32 - 32 - - - - - - - 775 - 530 - 200 - 40 - - - - <html><head/><body><p align="center">Close window</p></body></html> - - - - ../icon/window_close.png../icon/window_close.png - - - - 32 - 32 - - - - - - - 25 - 530 - 200 - 40 - - - - <html><head/><body><p align="center">Install package</p></body></html> - - - - - - - ../icon/package_install.png../icon/package_install.png - - - - 32 - 32 - - - - - - table_graphics - package_install - package_uninstall - orphans_remove - category_exit - - - - diff --git a/frontend/gui/ui/internet.ui b/frontend/gui/ui/internet.ui deleted file mode 100644 index 810c065..0000000 --- a/frontend/gui/ui/internet.ui +++ /dev/null @@ -1,220 +0,0 @@ - - - Internet - - - Qt::ApplicationModal - - - - 0 - 0 - 1000 - 600 - - - - - 0 - 0 - - - - - 1000 - 600 - - - - Sisyphus : Category Internet - - - - ../icon/category_internet.png../icon/category_internet.png - - - - - 25 - 25 - 950 - 475 - - - - - 950 - 500 - - - - QFrame::Panel - - - QFrame::Raised - - - QAbstractScrollArea::AdjustToContents - - - QAbstractItemView::NoEditTriggers - - - false - - - QAbstractItemView::SingleSelection - - - QAbstractItemView::SelectRows - - - true - - - 110 - - - true - - - false - - - - Category - - - - - Name - - - - - Available Version - - - - - Installed Version - - - - - Description - - - - - - - 275 - 530 - 200 - 40 - - - - <html><head/><body><p align="center">Uninstall package</p></body></html> - - - - - - - ../icon/package_uninstall.png../icon/package_uninstall.png - - - - 32 - 32 - - - - - - - 525 - 530 - 200 - 40 - - - - <html><head/><body><p align="center">Remove orphan packages</p></body></html> - - - - - - - ../icon/remove_orphans.png../icon/remove_orphans.png - - - - 32 - 32 - - - - - - - 775 - 530 - 200 - 40 - - - - <html><head/><body><p align="center">Close window</p></body></html> - - - - ../icon/window_close.png../icon/window_close.png - - - - 32 - 32 - - - - - - - 25 - 530 - 200 - 40 - - - - <html><head/><body><p align="center">Install package</p></body></html> - - - - - - - ../icon/package_install.png../icon/package_install.png - - - - 32 - 32 - - - - - - table_internet - package_install - package_uninstall - orphans_remove - category_exit - - - - diff --git a/frontend/gui/ui/local.ui b/frontend/gui/ui/local.ui deleted file mode 100644 index 46cd6f9..0000000 --- a/frontend/gui/ui/local.ui +++ /dev/null @@ -1,217 +0,0 @@ - - - Local - - - Qt::ApplicationModal - - - - 0 - 0 - 1000 - 600 - - - - - 0 - 0 - - - - - 1000 - 600 - - - - Sisyphus : Local Packages - - - - ../icon/category_local.png../icon/category_local.png - - - - - 25 - 25 - 950 - 475 - - - - - 950 - 500 - - - - QFrame::Panel - - - QFrame::Raised - - - QAbstractScrollArea::AdjustToContents - - - QAbstractItemView::NoEditTriggers - - - false - - - QAbstractItemView::SingleSelection - - - QAbstractItemView::SelectRows - - - true - - - true - - - false - - - - Category - - - - - Name - - - - - Version - - - - - Slot - - - - - Description - - - - - - - 275 - 530 - 200 - 40 - - - - <html><head/><body><p align="center">Uninstall package</p></body></html> - - - - - - - ../icon/package_uninstall.png../icon/package_uninstall.png - - - - 32 - 32 - - - - - - - 525 - 530 - 200 - 40 - - - - <html><head/><body><p align="center">Remove orphan packages</p></body></html> - - - - - - - ../icon/remove_orphans.png../icon/remove_orphans.png - - - - 32 - 32 - - - - - - - 775 - 530 - 200 - 40 - - - - <html><head/><body><p align="center">Close window</p></body></html> - - - - ../icon/window_close.png../icon/window_close.png - - - - 32 - 32 - - - - - - - 25 - 530 - 200 - 40 - - - - <html><head/><body><p align="center">Install package</p></body></html> - - - - - - - ../icon/package_install.png../icon/package_install.png - - - - 32 - 32 - - - - - - table_local - package_install - package_uninstall - orphans_remove - category_exit - - - - diff --git a/frontend/gui/ui/multimedia.ui b/frontend/gui/ui/multimedia.ui deleted file mode 100644 index b2c4938..0000000 --- a/frontend/gui/ui/multimedia.ui +++ /dev/null @@ -1,220 +0,0 @@ - - - Multimedia - - - Qt::ApplicationModal - - - - 0 - 0 - 1000 - 600 - - - - - 0 - 0 - - - - - 1000 - 600 - - - - Sisyphus : Category Multimedia - - - - ../icon/category_multimedia.png../icon/category_multimedia.png - - - - - 25 - 25 - 950 - 475 - - - - - 950 - 500 - - - - QFrame::Panel - - - QFrame::Raised - - - QAbstractScrollArea::AdjustToContents - - - QAbstractItemView::NoEditTriggers - - - false - - - QAbstractItemView::SingleSelection - - - QAbstractItemView::SelectRows - - - true - - - 110 - - - true - - - false - - - - Category - - - - - Name - - - - - Available Version - - - - - Installed Version - - - - - Description - - - - - - - 275 - 530 - 200 - 40 - - - - <html><head/><body><p align="center">Uninstall package</p></body></html> - - - - - - - ../icon/package_uninstall.png../icon/package_uninstall.png - - - - 32 - 32 - - - - - - - 525 - 530 - 200 - 40 - - - - <html><head/><body><p align="center">Remove orphan packages</p></body></html> - - - - - - - ../icon/remove_orphans.png../icon/remove_orphans.png - - - - 32 - 32 - - - - - - - 775 - 530 - 200 - 40 - - - - <html><head/><body><p align="center">Close window</p></body></html> - - - - ../icon/window_close.png../icon/window_close.png - - - - 32 - 32 - - - - - - - 25 - 530 - 200 - 40 - - - - <html><head/><body><p align="center">Install package</p></body></html> - - - - - - - ../icon/package_install.png../icon/package_install.png - - - - 32 - 32 - - - - - - table_multimedia - package_install - package_uninstall - orphans_remove - category_exit - - - - diff --git a/frontend/gui/ui/office.ui b/frontend/gui/ui/office.ui deleted file mode 100644 index d1d3bad..0000000 --- a/frontend/gui/ui/office.ui +++ /dev/null @@ -1,220 +0,0 @@ - - - Office - - - Qt::ApplicationModal - - - - 0 - 0 - 1000 - 600 - - - - - 0 - 0 - - - - - 1000 - 600 - - - - Sisyphus : Category Office - - - - ../icon/category_office.png../icon/category_office.png - - - - - 25 - 25 - 950 - 475 - - - - - 950 - 500 - - - - QFrame::Panel - - - QFrame::Raised - - - QAbstractScrollArea::AdjustToContents - - - QAbstractItemView::NoEditTriggers - - - false - - - QAbstractItemView::SingleSelection - - - QAbstractItemView::SelectRows - - - true - - - 110 - - - true - - - false - - - - Category - - - - - Name - - - - - Available Version - - - - - Installed Version - - - - - Description - - - - - - - 275 - 530 - 200 - 40 - - - - <html><head/><body><p align="center">Uninstall package</p></body></html> - - - - - - - ../icon/package_uninstall.png../icon/package_uninstall.png - - - - 32 - 32 - - - - - - - 525 - 530 - 200 - 40 - - - - <html><head/><body><p align="center">Remove orphan packages</p></body></html> - - - - - - - ../icon/remove_orphans.png../icon/remove_orphans.png - - - - 32 - 32 - - - - - - - 775 - 530 - 200 - 40 - - - - <html><head/><body><p align="center">Close window</p></body></html> - - - - ../icon/window_close.png../icon/window_close.png - - - - 32 - 32 - - - - - - - 25 - 530 - 200 - 40 - - - - <html><head/><body><p align="center">Install package</p></body></html> - - - - - - - ../icon/package_install.png../icon/package_install.png - - - - 32 - 32 - - - - - - table_office - package_install - package_uninstall - orphans_remove - category_exit - - - - diff --git a/frontend/gui/ui/sisyphus-gui.ui b/frontend/gui/ui/sisyphus-gui.ui deleted file mode 100644 index 0d6749c..0000000 --- a/frontend/gui/ui/sisyphus-gui.ui +++ /dev/null @@ -1,520 +0,0 @@ - - - MainWindow - - - - 0 - 0 - 1000 - 600 - - - - - 0 - 0 - - - - - 1000 - 600 - - - - Sisyphus : Graphical User Interface - - - - ../icon/window_icon.png../icon/window_icon.png - - - Qt::LeftToRight - - - true - - - - - 0 - 0 - - - - - - 0 - 0 - 1000 - 200 - - - - - 0 - 0 - - - - Qt::LeftToRight - - - true - - - QFrame::NoFrame - - - QFrame::Plain - - - - - 100 - 30 - 800 - 40 - - - - - 0 - 0 - - - - <html><head/><body><p align="center">Enter package name you want to Search/Install/Uninstall</p></body></html> - - - Enter package name... - - - true - - - Qt::AlignJustify|Qt::AlignVCenter - - - true - - - - - - 215 - 105 - 190 - 40 - - - - - 0 - 0 - - - - <html><head/><body><p align="center">Install package(s)</p></body></html> - - - - ../icon/package_install.png../icon/package_install.png - - - - 32 - 32 - - - - - - - 25 - 105 - 190 - 40 - - - - - 0 - 0 - - - - <html><head/><body><p align="center">Search package(s)</p></body></html> - - - - ../icon/package_search.png../icon/package_search.png - - - - 32 - 32 - - - - - - - 405 - 105 - 190 - 40 - - - - - 0 - 0 - - - - <html><head/><body><p align="center">Uninstall package(s)</p></body></html> - - - - ../icon/package_uninstall.png../icon/package_uninstall.png - - - - 32 - 32 - - - - - - - 595 - 105 - 190 - 40 - - - - - 0 - 0 - - - - <html><head/><body><p align="center">Upgrade system</p></body></html> - - - - ../icon/system_upgrade.png../icon/system_upgrade.png - - - - 32 - 32 - - - - - - - 785 - 105 - 190 - 40 - - - - - 0 - 0 - - - - <html><head/><body><p align="center">Remove orphan packages</p></body></html> - - - - ../icon/remove_orphans.png../icon/remove_orphans.png - - - - 32 - 32 - - - - - - - - 0 - 200 - 1000 - 400 - - - - QFrame::NoFrame - - - QFrame::Plain - - - - - 25 - 20 - 150 - 150 - - - - <html><head/><body><p align="center">Browse Accesories Category</p></body></html> - - - - ../icon/category_accessories.png../icon/category_accessories.png - - - - 64 - 64 - - - - - - - 425 - 20 - 150 - 150 - - - - <html><head/><body><p align="center">Browse Games Category</p></body></html> - - - - ../icon/category_games.png../icon/category_games.png - - - - 64 - 64 - - - - - - - 625 - 20 - 150 - 150 - - - - <html><head/><body><p align="center">Browse Graphics Category</p></body></html> - - - - ../icon/category_graphics.png../icon/category_graphics.png - - - - 64 - 64 - - - - - - - 825 - 20 - 150 - 150 - - - - <html><head/><body><p align="center">Browse Internet Category</p></body></html> - - - - ../icon/category_internet.png../icon/category_internet.png - - - - 64 - 64 - - - - - - - 25 - 215 - 150 - 150 - - - - <html><head/><body><p align="center">Browse Multimedia Category</p></body></html> - - - - ../icon/category_multimedia.png../icon/category_multimedia.png - - - - 64 - 64 - - - - - - - 225 - 215 - 150 - 150 - - - - <html><head/><body><p align="center">Browse Office Category</p></body></html> - - - - ../icon/category_office.png../icon/category_office.png - - - - 64 - 64 - - - - - - - 425 - 215 - 150 - 150 - - - - <html><head/><body><p align="center">Browse System Category</p></body></html> - - - - ../icon/category_system.png../icon/category_system.png - - - - 64 - 64 - - - - - - - 225 - 20 - 150 - 150 - - - - <html><head/><body><p align="center">Browse Development Category</p></body></html> - - - - ../icon/category_development.png../icon/category_development.png - - - - 64 - 64 - - - - - - - 625 - 215 - 150 - 150 - - - - <html><head/><body><p align="center">Browse All Packages</p></body></html> - - - - ../icon/category_all.png../icon/category_all.png - - - - 64 - 64 - - - - - - - 825 - 215 - 150 - 150 - - - - <html><head/><body><p align="center">Browse Installed Packages</p></body></html> - - - - - - - ../icon/category_local.png../icon/category_local.png - - - - 64 - 64 - - - - - - - - input - package_search - package_install - package_uninstall - system_upgrade - orphans_remove - category_accesories - category_development - category_games - category_graphics - category_internet - category_multimedia - category_office - category_system - category_local - category_everything - - - - diff --git a/frontend/gui/ui/system.ui b/frontend/gui/ui/system.ui deleted file mode 100644 index 59f1967..0000000 --- a/frontend/gui/ui/system.ui +++ /dev/null @@ -1,220 +0,0 @@ - - - System - - - Qt::ApplicationModal - - - - 0 - 0 - 1000 - 600 - - - - - 0 - 0 - - - - - 1000 - 600 - - - - Sisyphus : Category System - - - - ../icon/category_system.png../icon/category_system.png - - - - - 25 - 25 - 950 - 475 - - - - - 950 - 500 - - - - QFrame::Panel - - - QFrame::Raised - - - QAbstractScrollArea::AdjustToContents - - - QAbstractItemView::NoEditTriggers - - - false - - - QAbstractItemView::SingleSelection - - - QAbstractItemView::SelectRows - - - true - - - 110 - - - true - - - false - - - - Category - - - - - Name - - - - - Available Version - - - - - Installed Version - - - - - Description - - - - - - - 275 - 530 - 200 - 40 - - - - <html><head/><body><p align="center">Uninstall package</p></body></html> - - - - - - - ../icon/package_uninstall.png../icon/package_uninstall.png - - - - 32 - 32 - - - - - - - 525 - 530 - 200 - 40 - - - - <html><head/><body><p align="center">Remove orphan packages</p></body></html> - - - - - - - ../icon/remove_orphans.png../icon/remove_orphans.png - - - - 32 - 32 - - - - - - - 775 - 530 - 200 - 40 - - - - <html><head/><body><p align="center">Close window</p></body></html> - - - - ../icon/window_close.png../icon/window_close.png - - - - 32 - 32 - - - - - - - 25 - 530 - 200 - 40 - - - - <html><head/><body><p align="center">Install package</p></body></html> - - - - - - - ../icon/package_install.png../icon/package_install.png - - - - 32 - 32 - - - - - - table_system - package_install - package_uninstall - orphans_remove - category_exit - - - - diff --git a/helpers/make_local_csv_post b/helpers/make_local_csv_post deleted file mode 100755 index cd38974..0000000 --- a/helpers/make_local_csv_post +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env bash - -collect_local_portage_database() { - for i in $(qlist -ICv); do - pushd /var/db/pkg/$i > /dev/null 2>&1 - echo "$(> /tmp/local_postinst.csv - popd > /dev/null 2>&1 - done - mv /tmp/local_postinst.csv /var/lib/sisyphus/csv/ -} - -clean_temporary_files() { - rm -rf /tmp/local_postinst.csv -} - -main() { - collect_local_portage_database - clean_temporary_files -} - -main diff --git a/helpers/make_local_csv_pre b/helpers/make_local_csv_pre deleted file mode 100755 index 068331e..0000000 --- a/helpers/make_local_csv_pre +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env bash - -collect_local_portage_database() { - for i in $(qlist -ICv); do - pushd /var/db/pkg/$i > /dev/null 2>&1 - echo "$(> /tmp/local_preinst.csv - popd > /dev/null 2>&1 - done - mv /tmp/local_preinst.csv /var/lib/sisyphus/csv/ -} - -clean_temporary_files() { - rm -rf /tmp/local_preinst.csv -} - -main() { - collect_local_portage_database - clean_temporary_files -} - -main diff --git a/org.redcorelinux.sisyphus-gui.policy b/org.redcorelinux.sisyphus-gui.policy new file mode 100644 index 0000000..811c348 --- /dev/null +++ b/org.redcorelinux.sisyphus-gui.policy @@ -0,0 +1,22 @@ + + + + + Redcore Linux + http://redcorelinux.org + + + Run Sisyphus + Authentication is required to run Sisyphus + redcore-logo + + no + no + auth_admin + + /usr/bin/sisyphus-gui + true + + diff --git a/sisyphus-gui b/sisyphus-gui new file mode 100755 index 0000000..87254ec --- /dev/null +++ b/sisyphus-gui @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +# Sisyphus is a simple GUI for sisyphus, the portage wrapper +# Main Author : Ghiunhan Mamut @ Redcore Linux Project + +main() { + pushd /usr/share/sisyphus + python3 sisyphus-gui.py + popd +} + +main diff --git a/sisyphus-gui-pkexec b/sisyphus-gui-pkexec new file mode 100755 index 0000000..4a1b496 --- /dev/null +++ b/sisyphus-gui-pkexec @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +pkexec /usr/bin/sisyphus-gui diff --git a/sisyphus-gui.desktop b/sisyphus-gui.desktop new file mode 100755 index 0000000..c4ff12b --- /dev/null +++ b/sisyphus-gui.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Name=Sisyphus GUI +Type=Application +Comment=Sisyphus Package Manager (GUI) +Exec=sisyphus-gui-pkexec +Icon=sisyphus-gui +Categories=System; diff --git a/sisyphus-gui.png b/sisyphus-gui.png new file mode 100644 index 0000000..d36d93b Binary files /dev/null and b/sisyphus-gui.png differ diff --git a/src/backend/libsisyphus.sh b/src/backend/libsisyphus.sh new file mode 100755 index 0000000..530f9bf --- /dev/null +++ b/src/backend/libsisyphus.sh @@ -0,0 +1,179 @@ +#!/usr/bin/env bash + +# import gentoo functions +source /lib/gentoo/functions.sh + +checkroot () { + if [[ "$(whoami)" != root ]] ; then + eerror "You're not root?...No cookies for you, go away !!!" + exit 1 + fi +} + +checksystemmode() { + if [[ "$(readlink -f "/etc/portage/make.conf")" = /opt/redcore-build/conf/intel/portage/make.conf.amd64-srcmode ]] ; then + eerror "The system is set to srcmode (full Gentoo mode), cowardly refusing to run!" + exit 1 + fi +} + +checkportageconfig () { + pushd /opt/redcore-build > /dev/null 2>&1 + git remote update > /dev/null 2>&1 + export local confhash=$(git rev-parse @) + export local rconfhash=$(git rev-parse @{u}) + if [ $confhash != $rconfhash ] ; then + eerror "Portage config is out-of-date, run "sisyphus update" first" + exit 1 + fi + popd > /dev/null 2>&1 +} + +checkportagetree () { + pushd /usr/portage > /dev/null 2>&1 + git remote update > /dev/null 2>&1 + export local treehash=$(git rev-parse @) + export local rtreehash=$(git rev-parse @{u}) + if [ $treehash != $rtreehash ] ; then + eerror "Portage tree is out-of-date, run "sisyphus update" first" + exit 1 + fi + popd > /dev/null 2>&1 +} + +checkredcoreoverlay () { + pushd /var/lib/layman/redcore-desktop > /dev/null 2>&1 + git remote update > /dev/null 2>&1 + export local overlayhash=$(git rev-parse @) + export local roverlayhash=$(git rev-parse @{u}) + if [ $overlayhash != $roverlayhash ] ; then + eerror "Redcore Desktop overlay is out-of-date, run "sisyphus update" first" + exit 1 + fi +} + +remotedbcsvget () { + if [[ ! -f /var/lib/sisyphus/csv/remote_preinst.csv ]] ; then + pushd /var/lib/sisyphus/csv > /dev/null 2>&1 + touch remote_preinst.csv + wget -c http://mirror.math.princeton.edu/pub/redcorelinux/csv/remote_preinst.csv -O remote_postinst.csv > /dev/null 2>&1 + popd > /dev/null 2>&1 + elif [[ -f /var/lib/sisyphus/csv/remote_preinst.csv ]] ; then + pushd /var/lib/sisyphus/csv > /dev/null 2>&1 + wget -c http://mirror.math.princeton.edu/pub/redcorelinux/csv/remote_preinst.csv -O remote_postinst.csv > /dev/null 2>&1 + popd > /dev/null 2>&1 + fi +} + +remotedbcsvcheck () { + if ! cmp /var/lib/sisyphus/csv/remote_preinst.csv /var/lib/sisyphus/csv/remote_postinst.csv > /dev/null 2>&1 ; then + eerror "SisyphusDB : "remote_packages" table is out-of-date, run "sisyphus update" first" + rm -rf /var/lib/sisyphus/csv/remote_postinst.csv + exit 1 + elif cmp /var/lib/sisyphus/csv/remote_preinst.csv /var/lib/sisyphus/csv/remote_postinst.csv > /dev/null 2>&1 ; then + rm -rf /var/lib/sisyphus/csv/remote_postinst.csv + fi +} + +checkremotedb () { + remotedbcsvget + remotedbcsvcheck +} + +checksync () { + checkroot + checkportagetree + checkredcoreoverlay + checkportageconfig + checkremotedb +} + +syncrepos () { + emerge --sync +} + +syncportageconfig () { + pushd /opt/redcore-build > /dev/null 2>&1 + echo ">>> Syncing 'portage config' into '/etc/portage'..." + echo "/usr/bin/git pull" + git pull + echo "=== Sync completed for 'portage config'" + popd > /dev/null 2>&1 +} + +remotedbcsvsync () { + if ! cmp /var/lib/sisyphus/csv/remote_preinst.csv /var/lib/sisyphus/csv/remote_postinst.csv > /dev/null 2>&1 ; then + echo ">>> Syncing 'SisyphusDB remote_packages' into '/var/lib/sisyphus/db/sisyphus.db'" + echo "/usr/bin/sqlite3 /var/lib/sisyphus/db/sisyphus.db" + pushd /var/lib/sisyphus/db > /dev/null 2>&1 + sqlite3 -echo sisyphus.db<<-EXIT_HERE + drop table if exists remote_packages; + create table remote_packages (category TEXT,name TEXT,version TEXT,slot TEXT,description TEXT); + .mode csv + .import /var/lib/sisyphus/csv/remote_postinst.csv remote_packages + EXIT_HERE + popd > /dev/null 2>&1 + echo "=== Sync completed for 'SisyphusDB remote_packages'" + elif cmp /var/lib/sisyphus/csv/remote_preinst.csv /var/lib/sisyphus/csv/remote_postinst.csv > /dev/null 2>&1 ; then + echo ">>> Syncing 'SisyphusDB remote_packages' into '/var/lib/sisyphus/db/sisyphus.db'" + echo "/usr/bin/sqlite3 /var/lib/sisyphus/db/sisyphus.db" + echo "Already up-to-date." + echo "=== Sync completed for 'SisyphusDB remote_packages'" + fi + mv /var/lib/sisyphus/csv/remote_postinst.csv /var/lib/sisyphus/csv/remote_preinst.csv +} + +syncremotedb() { + remotedbcsvget + remotedbcsvsync +} + +redcoresync () { + checkroot + syncrepos + syncportageconfig + syncremotedb +} + +localdbcsvpre () { + if [[ ! -f /var/lib/sisyphus/csv/local_preinst.csv ]] ; then + for i in $(qlist -ICv); do + pushd /var/db/pkg/$i > /dev/null 2>&1 + echo "$(> /var/lib/sisyphus/csv/local_preinst.csv + popd > /dev/null 2>&1 + done + fi +} + +localdbcsvpost () { + for i in $(qlist -ICv); do + pushd /var/db/pkg/$i > /dev/null 2>&1 + echo "$(> /var/lib/sisyphus/csv/local_postinst.csv + popd > /dev/null 2>&1 + done +} + +localdbcsvsync () { + if cmp /var/lib/sisyphus/csv/local_preinst.csv /var/lib/sisyphus/csv/local_postinst.csv > /dev/null 2>&1 ; then + einfo "'PortageDB' && 'SisyphusDB local_packages' are in sync, nothing to do..." + else + einfo "'PortageDB' && 'SisyphusDB local_packages' are out of sync, syncing now..." + echo "/usr/bin/sqlite3 /var/lib/sisyphus/db/sisyphus.db" + pushd /var/lib/sisyphus/db > /dev/null 2>&1 + sqlite3 -echo sisyphus.db<<-EXIT_HERE + drop table if exists local_packages; + create table local_packages (category TEXT,name TEXT,version TEXT,slot TEXT,description TEXT); + .mode csv + .import /var/lib/sisyphus/csv/local_postinst.csv local_packages + EXIT_HERE + popd > /dev/null 2>&1 + einfo "'PortageDB' && 'SisyphusDB local_packages' resync complete..." + fi + mv /var/lib/sisyphus/csv/local_postinst.csv /var/lib/sisyphus/csv/local_preinst.csv +} + +updatelocaldb () { + checkroot + localdbcsvpost + localdbcsvsync +} diff --git a/src/frontend/cli/sisyphus-cli.py b/src/frontend/cli/sisyphus-cli.py new file mode 100755 index 0000000..3d4fb3a --- /dev/null +++ b/src/frontend/cli/sisyphus-cli.py @@ -0,0 +1,33 @@ +#!/usr/bin/python3 + +import sys +import subprocess +from libsisyphus import * + +check_if_srcmode() + +if "__main__" == __name__: + if "install" in sys.argv[1:]: + sisyphus_pkg_install() + elif "uninstall" in sys.argv[1:]: + sisyphus_pkg_uninstall() + elif "force-uninstall" in sys.argv[1:]: + sisyphus_pkg_force_uninstall() + elif "remove-orphans" in sys.argv[1:]: + sisyphus_pkg_remove_orphans() + elif "upgrade" in sys.argv[1:]: + sisyphus_pkg_system_upgrade() + elif "auto-install" in sys.argv[1:]: + sisyphus_pkg_auto_install() + elif "auto-uninstall" in sys.argv[1:]: + sisyphus_pkg_auto_uninstall() + elif "auto-force-uninstall" in sys.argv[1:]: + sisyphus_pkg_auto_force_uninstall() + elif "auto-remove-orphans" in sys.argv[1:]: + sisyphus_pkg_auto_remove_orphans() + elif "auto-upgrade" in sys.argv[1:]: + sisyphus_pkg_auto_system_upgrade() + elif "search" in sys.argv[1:]: + sisyphus_pkg_search() + elif "update" in sys.argv[1:]: + sisyphus_pkg_system_update() diff --git a/src/frontend/cli/sisyphus-cli.sh b/src/frontend/cli/sisyphus-cli.sh new file mode 100755 index 0000000..79023aa --- /dev/null +++ b/src/frontend/cli/sisyphus-cli.sh @@ -0,0 +1,116 @@ +#!/usr/bin/env bash + +source /usr/lib/sisyphus/libsisyphus.sh + +checksystemmode + +action=$1 +shift + +case "$action" in + install) + checksync + localdbcsvpre + emerge -a "$@" + updatelocaldb + ;; + uninstall) + checksync + localdbcsvpre + emerge --depclean -a "$@" + updatelocaldb + ;; + force-uninstall) + checksync + localdbcsvpre + emerge --unmerge -a "$@" + updatelocaldb + ;; + remove-orphans) + checksync + localdbcsvpre + emerge --depclean -a + updatelocaldb + ;; + upgrade) + checksync + localdbcsvpre + emerge -uDaN --with-bdeps=y @system @world "$@" + updatelocaldb + ;; + auto-install) + redcoresync + localdbcsvpre + emerge "$@" + updatelocaldb + ;; + auto-uninstall) + redcoresync + localdbcsvpre + emerge --depclean "$@" + updatelocaldb + ;; + auto-force-uninstall) + redcoresync + localdbcsvpre + emerge --unmerge "$@" + updatelocaldb + ;; + auto-remove-orphans) + redcoresync + localdbcsvpre + emerge --depclean -q + updatelocaldb + ;; + auto-upgrade) + redcoresync + localdbcsvpre + emerge -uDN --with-bdeps=y @system @world "$@" + updatelocaldb + ;; + search) + emerge -s "$@" + ;; + update) + redcoresync + ;; + belongs) + equery belongs "$@" + ;; + depends) + equery depends "$@" + ;; + files) + equery files "$@" + ;; + sysinfo) + emerge --info + ;; + *) + cat <<-"EOH" + Usage: sisyphus command [package(s)] + + sisyphus is a simple wrapper around portage, gentoolkit, and portage-utils that provides an + apt-get/yum-alike interface to these commands, to assist people transitioning from + Debian/RedHat-based systems to Gentoo. + + Commands : + install - Install new packages + uninstall - Uninstall packages safely + force-uninstall - *Unsafely* uninstall packages + remove-orphans - Uninstall packages that are no longer needed + upgrade - Upgrade system + auto-install - Install new packages (no confirmation) + auto-uninstall - Uninstall packages safely (no confirmation) + auto-force-uninstall - *Unsafely* uninstall packages (no confirmation) + auto-remove-orphans - Uninstall packages that are no longer needed (no confirmation) + auto-upgrade - Upgrade system (no confirmation) + search - Search for packages + update - Resync portage tree, portage config && redcore overlay + belongs - List what package FILE(s) belong to + depends - List all packages directly depending on given package + files - List all files installed by package + sysinfo - Display information about installed core packages and portage configuration + EOH + ;; +esac diff --git a/src/frontend/gui/accesories.py b/src/frontend/gui/accesories.py new file mode 100755 index 0000000..32d3b68 --- /dev/null +++ b/src/frontend/gui/accesories.py @@ -0,0 +1,50 @@ +#!/usr/bin/python3 +import sys, subprocess, sqlite3 +from PyQt5 import QtCore, QtGui, QtWidgets, uic + +class Accesories(QtWidgets.QMainWindow): + def __init__(self): + super(Accesories, self).__init__() + uic.loadUi('ui/accesories.ui', self) + self.centerOnScreen() + self.show() + self.load_packages() + + self.package_install.clicked.connect(self.install_package) + self.package_uninstall.clicked.connect(self.uninstall_package) + self.orphans_remove.clicked.connect(self.remove_orphans) + self.category_exit.clicked.connect(self.exit_category) + + def centerOnScreen(self): + resolution = QtWidgets.QDesktopWidget().screenGeometry() + self.move((resolution.width() / 2) - (self.frameSize().width() / 2), + (resolution.height() / 2) - (self.frameSize().height() / 2)) + + def install_package(self): + pkgname = self.table_accesories.item(self.table_accesories.currentRow(), 1).text() + subprocess.Popen(['xterm', '-e', 'sisyphus', 'auto-install'] + pkgname.split()) + + def uninstall_package(self): + pkgname = self.table_accesories.item(self.table_accesories.currentRow(), 1).text() + subprocess.Popen(['xterm', '-e', 'sisyphus', 'auto-uninstall'] + pkgname.split()) + + def remove_orphans(self): + subprocess.Popen(['xterm', '-e', 'sisyphus', 'remove-orphans']) + + def exit_category(self): + self.close() + + def load_packages(self): + with sqlite3.connect('/var/lib/sisyphus/db/sisyphus.db') as db: + cursor=db.cursor() + cursor.execute('''SELECT * from remote_packages''') + rows = cursor.fetchall() + + for row in rows: + inx = rows.index(row) + self.table_accesories.insertRow(inx) + self.table_accesories.setItem(inx, 0, QtWidgets.QTableWidgetItem(row[0])) + self.table_accesories.setItem(inx, 1, QtWidgets.QTableWidgetItem(row[1])) + self.table_accesories.setItem(inx, 2, QtWidgets.QTableWidgetItem(row[2])) + self.table_accesories.setItem(inx, 3, QtWidgets.QTableWidgetItem(row[3])) + self.table_accesories.setItem(inx, 4, QtWidgets.QTableWidgetItem(row[4])) diff --git a/src/frontend/gui/development.py b/src/frontend/gui/development.py new file mode 100755 index 0000000..ede83a4 --- /dev/null +++ b/src/frontend/gui/development.py @@ -0,0 +1,50 @@ +#!/usr/bin/python3 +import sys, subprocess, sqlite3 +from PyQt5 import QtCore, QtGui, QtWidgets, uic + +class Development(QtWidgets.QMainWindow): + def __init__(self): + super(Development, self).__init__() + uic.loadUi('ui/development.ui', self) + self.centerOnScreen() + self.show() + self.load_packages() + + self.package_install.clicked.connect(self.install_package) + self.package_uninstall.clicked.connect(self.uninstall_package) + self.orphans_remove.clicked.connect(self.remove_orphans) + self.category_exit.clicked.connect(self.exit_category) + + def centerOnScreen(self): + resolution = QtWidgets.QDesktopWidget().screenGeometry() + self.move((resolution.width() / 2) - (self.frameSize().width() / 2), + (resolution.height() / 2) - (self.frameSize().height() / 2)) + + def install_package(self): + pkgname = self.table_development.item(self.table_development.currentRow(), 1).text() + subprocess.Popen(['xterm', '-e', 'sisyphus', 'auto-install'] + pkgname.split()) + + def uninstall_package(self): + pkgname = self.table_development.item(self.table_development.currentRow(), 1).text() + subprocess.Popen(['xterm', '-e', 'sisyphus', 'auto-uninstall'] + pkgname.split()) + + def remove_orphans(self): + subprocess.Popen(['xterm', '-e', 'sisyphus', 'auto-uninstall']) + + def exit_category(self): + self.close() + + def load_packages(self): + with sqlite3.connect('/var/lib/sisyphus/db/sisyphus.db') as db: + cursor=db.cursor() + cursor.execute('''SELECT * from remote_packages''') + rows = cursor.fetchall() + + for row in rows: + inx = rows.index(row) + self.table_development.insertRow(inx) + self.table_development.setItem(inx, 0, QtWidgets.QTableWidgetItem(row[0])) + self.table_development.setItem(inx, 1, QtWidgets.QTableWidgetItem(row[1])) + self.table_development.setItem(inx, 2, QtWidgets.QTableWidgetItem(row[2])) + self.table_development.setItem(inx, 3, QtWidgets.QTableWidgetItem(row[3])) + self.table_development.setItem(inx, 4, QtWidgets.QTableWidgetItem(row[4])) diff --git a/src/frontend/gui/everything.py b/src/frontend/gui/everything.py new file mode 100755 index 0000000..ac83ca6 --- /dev/null +++ b/src/frontend/gui/everything.py @@ -0,0 +1,61 @@ +#!/usr/bin/python3 +import sys, subprocess, sqlite3 +from PyQt5 import QtCore, QtGui, QtWidgets, uic + +class Everything(QtWidgets.QMainWindow): + def __init__(self): + super(Everything, self).__init__() + uic.loadUi('ui/everything.ui', self) + self.centerOnScreen() + self.show() + self.load_packages() + + self.package_install.clicked.connect(self.install_package) + self.package_uninstall.clicked.connect(self.uninstall_package) + self.orphans_remove.clicked.connect(self.remove_orphans) + self.category_exit.clicked.connect(self.exit_category) + + def centerOnScreen(self): + resolution = QtWidgets.QDesktopWidget().screenGeometry() + self.move((resolution.width() / 2) - (self.frameSize().width() / 2), + (resolution.height() / 2) - (self.frameSize().height() / 2)) + + def install_package(self): + pkgname = self.table_everything.item(self.table_everything.currentRow(), 1).text() + subprocess.Popen(['xterm', '-e', 'sisyphus', 'auto-install'] + pkgname.split()) + + def uninstall_package(self): + pkgname = self.table_everything.item(self.table_everything.currentRow(), 1).text() + subprocess.Popen(['xterm', '-e', 'sisyphus', 'auto-uninstall'] + pkgname.split()) + + def remove_orphans(self): + subprocess.Popen(['xterm', '-e', 'sisyphus', 'remove-orphans']) + + def exit_category(self): + self.close() + + def load_packages(self): + with sqlite3.connect('/var/lib/sisyphus/db/sisyphus.db') as db: + cursor=db.cursor() + cursor.execute('''SELECT + a.category AS cat, + a.name AS pn, + a.version AS av, + i.version AS iv, + a.description AS descr + 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 + ''') + rows = cursor.fetchall() + + for row in rows: + inx = rows.index(row) + self.table_everything.insertRow(inx) + self.table_everything.setItem(inx, 0, QtWidgets.QTableWidgetItem(row[0])) + self.table_everything.setItem(inx, 1, QtWidgets.QTableWidgetItem(row[1])) + self.table_everything.setItem(inx, 2, QtWidgets.QTableWidgetItem(row[2])) + self.table_everything.setItem(inx, 3, QtWidgets.QTableWidgetItem(row[3])) + self.table_everything.setItem(inx, 4, QtWidgets.QTableWidgetItem(row[4])) diff --git a/src/frontend/gui/games.py b/src/frontend/gui/games.py new file mode 100755 index 0000000..5eed9fa --- /dev/null +++ b/src/frontend/gui/games.py @@ -0,0 +1,77 @@ +#!/usr/bin/python3 +import sys, subprocess, sqlite3 +from PyQt5 import QtCore, QtGui, QtWidgets, uic + +class Games(QtWidgets.QMainWindow): + def __init__(self): + super(Games, self).__init__() + uic.loadUi('ui/games.ui', self) + self.centerOnScreen() + self.show() + self.load_packages() + + self.package_install.clicked.connect(self.install_package) + self.package_uninstall.clicked.connect(self.uninstall_package) + self.orphans_remove.clicked.connect(self.remove_orphans) + self.category_exit.clicked.connect(self.exit_category) + + def centerOnScreen(self): + resolution = QtWidgets.QDesktopWidget().screenGeometry() + self.move((resolution.width() / 2) - (self.frameSize().width() / 2), + (resolution.height() / 2) - (self.frameSize().height() / 2)) + + def install_package(self): + pkgname = self.table_games.item(self.table_games.currentRow(), 1).text() + subprocess.Popen(['xterm', '-e', 'sisyphus', 'auto-install'] + pkgname.split()) + + def uninstall_package(self): + pkgname = self.table_games.item(self.table_games.currentRow(), 1).text() + subprocess.Popen(['xterm', '-e', 'sisyphus', 'auto-uninstall'] + pkgname.split()) + + def remove_orphans(self): + subprocess.Popen(['xterm', '-e', 'sisyphus', 'remove-orphans']) + + def exit_category(self): + self.close() + + def load_packages(self): + with sqlite3.connect('/var/lib/sisyphus/db/sisyphus.db') as db: + cursor=db.cursor() + cursor.execute('''SELECT + a.category AS cat, + a.name AS pn, + a.version AS av, + i.version AS iv, + a.description AS descr + 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 a.name IN + ('steam', + 'playonlinux', + 'armagetronad', + 'chromium-bsu', + 'supertuxkart', + 'teeworlds', + 'dosbox', + 'snes9x', + 'zsnes', + 'urbanterror', + 'openttd', + '0ad', + 'warzone2100', + 'wesnoth', + 'xonotic') + ''') + rows = cursor.fetchall() + + for row in rows: + inx = rows.index(row) + self.table_games.insertRow(inx) + self.table_games.setItem(inx, 0, QtWidgets.QTableWidgetItem(row[0])) + self.table_games.setItem(inx, 1, QtWidgets.QTableWidgetItem(row[1])) + self.table_games.setItem(inx, 2, QtWidgets.QTableWidgetItem(row[2])) + self.table_games.setItem(inx, 3, QtWidgets.QTableWidgetItem(row[3])) + self.table_games.setItem(inx, 4, QtWidgets.QTableWidgetItem(row[4])) diff --git a/src/frontend/gui/graphics.py b/src/frontend/gui/graphics.py new file mode 100755 index 0000000..a50a169 --- /dev/null +++ b/src/frontend/gui/graphics.py @@ -0,0 +1,50 @@ +#!/usr/bin/python3 +import sys, subprocess, sqlite3 +from PyQt5 import QtCore, QtGui, QtWidgets, uic + +class Graphics(QtWidgets.QMainWindow): + def __init__(self): + super(Graphics, self).__init__() + uic.loadUi('ui/graphics.ui', self) + self.centerOnScreen() + self.show() + self.load_packages() + + self.package_install.clicked.connect(self.install_package) + self.package_uninstall.clicked.connect(self.uninstall_package) + self.orphans_remove.clicked.connect(self.remove_orphans) + self.category_exit.clicked.connect(self.exit_category) + + def centerOnScreen(self): + resolution = QtWidgets.QDesktopWidget().screenGeometry() + self.move((resolution.width() / 2) - (self.frameSize().width() / 2), + (resolution.height() / 2) - (self.frameSize().height() / 2)) + + def install_package(self): + pkgname = self.table_graphics.item(self.table_graphics.currentRow(), 1).text() + subprocess.Popen(['xterm', '-e', 'sisyphus', 'auto-install'] + pkgname.split()) + + def uninstall_package(self): + pkgname = self.table_graphics.item(self.table_graphics.currentRow(), 1).text() + subprocess.Popen(['xterm', '-e', 'sisyphus', 'auto-uninstall'] + pkgname.split()) + + def remove_orphans(self): + subprocess.Popen(['xterm', '-e', 'sisyphus', 'remove-orphans']) + + def exit_category(self): + self.close() + + def load_packages(self): + with sqlite3.connect('/var/lib/sisyphus/db/sisyphus.db') as db: + cursor=db.cursor() + cursor.execute('''SELECT * from remote_packages''') + rows = cursor.fetchall() + + for row in rows: + inx = rows.index(row) + self.table_graphics.insertRow(inx) + self.table_graphics.setItem(inx, 0, QtWidgets.QTableWidgetItem(row[0])) + self.table_graphics.setItem(inx, 1, QtWidgets.QTableWidgetItem(row[1])) + self.table_graphics.setItem(inx, 2, QtWidgets.QTableWidgetItem(row[2])) + self.table_graphics.setItem(inx, 3, QtWidgets.QTableWidgetItem(row[3])) + self.table_graphics.setItem(inx, 4, QtWidgets.QTableWidgetItem(row[4])) diff --git a/src/frontend/gui/icon/category_accessories.png b/src/frontend/gui/icon/category_accessories.png new file mode 100644 index 0000000..becbfc9 Binary files /dev/null and b/src/frontend/gui/icon/category_accessories.png differ diff --git a/src/frontend/gui/icon/category_all.png b/src/frontend/gui/icon/category_all.png new file mode 100644 index 0000000..462c97c Binary files /dev/null and b/src/frontend/gui/icon/category_all.png differ diff --git a/src/frontend/gui/icon/category_development.png b/src/frontend/gui/icon/category_development.png new file mode 100644 index 0000000..b2c160e Binary files /dev/null and b/src/frontend/gui/icon/category_development.png differ diff --git a/src/frontend/gui/icon/category_games.png b/src/frontend/gui/icon/category_games.png new file mode 100644 index 0000000..b128490 Binary files /dev/null and b/src/frontend/gui/icon/category_games.png differ diff --git a/src/frontend/gui/icon/category_graphics.png b/src/frontend/gui/icon/category_graphics.png new file mode 100644 index 0000000..63c7c5e Binary files /dev/null and b/src/frontend/gui/icon/category_graphics.png differ diff --git a/src/frontend/gui/icon/category_internet.png b/src/frontend/gui/icon/category_internet.png new file mode 100644 index 0000000..9f630cd Binary files /dev/null and b/src/frontend/gui/icon/category_internet.png differ diff --git a/src/frontend/gui/icon/category_local.png b/src/frontend/gui/icon/category_local.png new file mode 100644 index 0000000..561d218 Binary files /dev/null and b/src/frontend/gui/icon/category_local.png differ diff --git a/src/frontend/gui/icon/category_multimedia.png b/src/frontend/gui/icon/category_multimedia.png new file mode 100644 index 0000000..e6414e6 Binary files /dev/null and b/src/frontend/gui/icon/category_multimedia.png differ diff --git a/src/frontend/gui/icon/category_office.png b/src/frontend/gui/icon/category_office.png new file mode 100644 index 0000000..78af8a4 Binary files /dev/null and b/src/frontend/gui/icon/category_office.png differ diff --git a/src/frontend/gui/icon/category_system.png b/src/frontend/gui/icon/category_system.png new file mode 100644 index 0000000..2a360bd Binary files /dev/null and b/src/frontend/gui/icon/category_system.png differ diff --git a/src/frontend/gui/icon/package_install.png b/src/frontend/gui/icon/package_install.png new file mode 100644 index 0000000..736cddf Binary files /dev/null and b/src/frontend/gui/icon/package_install.png differ diff --git a/src/frontend/gui/icon/package_search.png b/src/frontend/gui/icon/package_search.png new file mode 100644 index 0000000..5f50a53 Binary files /dev/null and b/src/frontend/gui/icon/package_search.png differ diff --git a/src/frontend/gui/icon/package_uninstall.png b/src/frontend/gui/icon/package_uninstall.png new file mode 100644 index 0000000..187ce04 Binary files /dev/null and b/src/frontend/gui/icon/package_uninstall.png differ diff --git a/src/frontend/gui/icon/remove_orphans.png b/src/frontend/gui/icon/remove_orphans.png new file mode 100644 index 0000000..b165bf7 Binary files /dev/null and b/src/frontend/gui/icon/remove_orphans.png differ diff --git a/src/frontend/gui/icon/system_upgrade.png b/src/frontend/gui/icon/system_upgrade.png new file mode 100644 index 0000000..4443cb7 Binary files /dev/null and b/src/frontend/gui/icon/system_upgrade.png differ diff --git a/src/frontend/gui/icon/window_close.png b/src/frontend/gui/icon/window_close.png new file mode 100644 index 0000000..35dbf35 Binary files /dev/null and b/src/frontend/gui/icon/window_close.png differ diff --git a/src/frontend/gui/icon/window_icon.png b/src/frontend/gui/icon/window_icon.png new file mode 100644 index 0000000..da169ba Binary files /dev/null and b/src/frontend/gui/icon/window_icon.png differ diff --git a/src/frontend/gui/internet.py b/src/frontend/gui/internet.py new file mode 100755 index 0000000..e8ad1d3 --- /dev/null +++ b/src/frontend/gui/internet.py @@ -0,0 +1,100 @@ +#!/usr/bin/python3 +import sys, subprocess, sqlite3 +from PyQt5 import QtCore, QtGui, QtWidgets, uic + +class Internet(QtWidgets.QMainWindow): + def __init__(self): + super(Internet, self).__init__() + uic.loadUi('ui/internet.ui', self) + self.centerOnScreen() + self.show() + self.load_packages() + + self.package_install.clicked.connect(self.install_package) + self.package_uninstall.clicked.connect(self.uninstall_package) + self.orphans_remove.clicked.connect(self.remove_orphans) + self.category_exit.clicked.connect(self.exit_category) + + def centerOnScreen(self): + resolution = QtWidgets.QDesktopWidget().screenGeometry() + self.move((resolution.width() / 2) - (self.frameSize().width() / 2), + (resolution.height() / 2) - (self.frameSize().height() / 2)) + + def install_package(self): + pkgname = self.table_internet.item(self.table_internet.currentRow(), 1).text() + subprocess.Popen(['xterm', '-e', 'sisyphus', 'auto-install'] + pkgname.split()) + + def uninstall_package(self): + pkgname = self.table_internet.item(self.table_internet.currentRow(), 1).text() + subprocess.Popen(['xterm', '-e', 'sisyphus', 'auto-uninstall'] + pkgname.split()) + + def remove_orphans(self): + subprocess.Popen(['xterm', '-e', 'sisyphus', 'remove-orphans']) + + def exit_category(self): + self.close() + + def load_packages(self): + with sqlite3.connect('/var/lib/sisyphus/db/sisyphus.db') as db: + cursor=db.cursor() + cursor.execute('''SELECT + a.category AS cat, + a.name AS pn, + a.version AS av, + i.version AS iv, + a.description AS descr + 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 a.name IN + ('firewalld', + 'ufw', + 'ufw-frontends', + 'cifs-utils', + 'samba', + 'sshfs', + 'filezilla', + 'franz', + 'qtox', + 'telegram', + 'viber', + 'konversation', + 'quassel', + 'aria2', + 'dropbox', + 'megasync', + 'owncloud-client', + 'teamviewer', + 'telnet-bsd', + 'tigervnc', + 'youtube-dl', + 'quiterss', + 'qbittorrent', + 'transmission', + 'firefox', + 'google-chrome', + 'opera', + 'qupzilla', + 'vivaldi', + 'adobe-flash', + 'chrome-binary-plugins', + 'freshplayerplugin', + 'google-talkplugin', + 'wmail', + 'trojita', + 'aircrack-ng', + 'wavemon', + 'messengerfordesktop') + ''') + rows = cursor.fetchall() + + for row in rows: + inx = rows.index(row) + self.table_internet.insertRow(inx) + self.table_internet.setItem(inx, 0, QtWidgets.QTableWidgetItem(row[0])) + self.table_internet.setItem(inx, 1, QtWidgets.QTableWidgetItem(row[1])) + self.table_internet.setItem(inx, 2, QtWidgets.QTableWidgetItem(row[2])) + self.table_internet.setItem(inx, 3, QtWidgets.QTableWidgetItem(row[3])) + self.table_internet.setItem(inx, 4, QtWidgets.QTableWidgetItem(row[4])) diff --git a/src/frontend/gui/local.py b/src/frontend/gui/local.py new file mode 100755 index 0000000..e8b506a --- /dev/null +++ b/src/frontend/gui/local.py @@ -0,0 +1,50 @@ +#!/usr/bin/python3 +import sys, subprocess, sqlite3 +from PyQt5 import QtCore, QtGui, QtWidgets, uic + +class Local(QtWidgets.QMainWindow): + def __init__(self): + super(Local, self).__init__() + uic.loadUi('ui/local.ui', self) + self.centerOnScreen() + self.show() + self.load_packages() + + self.package_install.clicked.connect(self.install_package) + self.package_uninstall.clicked.connect(self.uninstall_package) + self.orphans_remove.clicked.connect(self.remove_orphans) + self.category_exit.clicked.connect(self.exit_category) + + def centerOnScreen(self): + resolution = QtWidgets.QDesktopWidget().screenGeometry() + self.move((resolution.width() / 2) - (self.frameSize().width() / 2), + (resolution.height() / 2) - (self.frameSize().height() / 2)) + + def install_package(self): + pkgname = self.table_local.item(self.table_local.currentRow(), 1).text() + subprocess.Popen(['xterm', '-e', 'sisyphus', 'auto-install'] + pkgname.split()) + + def uninstall_package(self): + pkgname = self.table_local.item(self.table_local.currentRow(), 1).text() + subprocess.Popen(['xterm', '-e', 'sisyphus', 'auto-uninstall'] + pkgname.split()) + + def remove_orphans(self): + subprocess.Popen(['xterm', '-e', 'sisyphus', 'remove-orphans']) + + def exit_category(self): + self.close() + + def load_packages(self): + with sqlite3.connect('/var/lib/sisyphus/db/sisyphus.db') as db: + cursor=db.cursor() + cursor.execute('''SELECT * from local_packages''') + rows = cursor.fetchall() + + for row in rows: + inx = rows.index(row) + self.table_local.insertRow(inx) + self.table_local.setItem(inx, 0, QtWidgets.QTableWidgetItem(row[0])) + self.table_local.setItem(inx, 1, QtWidgets.QTableWidgetItem(row[1])) + self.table_local.setItem(inx, 2, QtWidgets.QTableWidgetItem(row[2])) + self.table_local.setItem(inx, 3, QtWidgets.QTableWidgetItem(row[3])) + self.table_local.setItem(inx, 4, QtWidgets.QTableWidgetItem(row[4])) diff --git a/src/frontend/gui/multimedia.py b/src/frontend/gui/multimedia.py new file mode 100755 index 0000000..e4214f2 --- /dev/null +++ b/src/frontend/gui/multimedia.py @@ -0,0 +1,50 @@ +#!/usr/bin/python3 +import sys, subprocess, sqlite3 +from PyQt5 import QtCore, QtGui, QtWidgets, uic + +class Multimedia(QtWidgets.QMainWindow): + def __init__(self): + super(Multimedia, self).__init__() + uic.loadUi('ui/multimedia.ui', self) + self.centerOnScreen() + self.show() + self.load_packages() + + self.package_install.clicked.connect(self.install_package) + self.package_uninstall.clicked.connect(self.uninstall_package) + self.orphans_remove.clicked.connect(self.remove_orphans) + self.category_exit.clicked.connect(self.exit_category) + + def centerOnScreen(self): + resolution = QtWidgets.QDesktopWidget().screenGeometry() + self.move((resolution.width() / 2) - (self.frameSize().width() / 2), + (resolution.height() / 2) - (self.frameSize().height() / 2)) + + def install_package(self): + pkgname = self.table_multimedia.item(self.table_multimedia.currentRow(), 1).text() + subprocess.Popen(['xterm', '-e', 'sisyphus', 'auto-install'] + pkgname.split()) + + def uninstall_package(self): + pkgname = self.table_multimedia.item(self.table_multimedia.currentRow(), 1).text() + subprocess.Popen(['xterm', '-e', 'sisyphus', 'auto-uninstall'] + pkgname.split()) + + def remove_orphans(self): + subprocess.Popen(['xterm', '-e', 'sisyphus', 'remove-orphans']) + + def exit_category(self): + self.close() + + def load_packages(self): + with sqlite3.connect('/var/lib/sisyphus/db/sisyphus.db') as db: + cursor=db.cursor() + cursor.execute('''SELECT * from remote_packages''') + rows = cursor.fetchall() + + for row in rows: + inx = rows.index(row) + self.table_multimedia.insertRow(inx) + self.table_multimedia.setItem(inx, 0, QtWidgets.QTableWidgetItem(row[0])) + self.table_multimedia.setItem(inx, 1, QtWidgets.QTableWidgetItem(row[1])) + self.table_multimedia.setItem(inx, 2, QtWidgets.QTableWidgetItem(row[2])) + self.table_multimedia.setItem(inx, 3, QtWidgets.QTableWidgetItem(row[3])) + self.table_multimedia.setItem(inx, 4, QtWidgets.QTableWidgetItem(row[4])) diff --git a/src/frontend/gui/office.py b/src/frontend/gui/office.py new file mode 100755 index 0000000..286494a --- /dev/null +++ b/src/frontend/gui/office.py @@ -0,0 +1,84 @@ +#!/usr/bin/python3 +import sys, subprocess, sqlite3 +from PyQt5 import QtCore, QtGui, QtWidgets, uic + +class Office(QtWidgets.QMainWindow): + def __init__(self): + super(Office, self).__init__() + uic.loadUi('ui/office.ui', self) + self.centerOnScreen() + self.show() + self.load_packages() + + self.package_install.clicked.connect(self.install_package) + self.package_uninstall.clicked.connect(self.uninstall_package) + self.orphans_remove.clicked.connect(self.remove_orphans) + self.category_exit.clicked.connect(self.exit_category) + + def centerOnScreen(self): + resolution = QtWidgets.QDesktopWidget().screenGeometry() + self.move((resolution.width() / 2) - (self.frameSize().width() / 2), + (resolution.height() / 2) - (self.frameSize().height() / 2)) + + def install_package(self): + pkgname = self.table_office.item(self.table_office.currentRow(), 1).text() + subprocess.Popen(['xterm', '-e', 'sisyphus', 'auto-install'] + pkgname.split()) + + def uninstall_package(self): + pkgname = self.table_office.item(self.table_office.currentRow(), 1).text() + subprocess.Popen(['xterm', '-e', 'sisyphus', 'auto-uninstall'] + pkgname.split()) + + def remove_orphans(self): + subprocess.Popen(['xterm', '-e', 'sisyphus', 'remove-orphans']) + + def exit_category(self): + self.close() + + def load_packages(self): + with sqlite3.connect('/var/lib/sisyphus/db/sisyphus.db') as db: + cursor=db.cursor() + cursor.execute('''SELECT + a.category AS cat, + a.name AS pn, + a.version AS av, + i.version AS iv, + a.description AS descr + 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 a.name IN + ('fet', + 'libreoffice', + 'wps-office', + 'tesseract', + 'okular', + 'cantarell', + 'corefonts', + 'dejavu', + 'liberation-fonts', + 'libertine', + 'noto', + 'open-sans', + 'roboto', + 'ttf-bitstream-vera', + 'qpdfview', + 'cups', + 'cups-filters', + 'cups-pdf', + 'simple-scan', + 'cnijfilter', + 'cnijfilter-drivers', + 'hplip') + ''') + rows = cursor.fetchall() + + for row in rows: + inx = rows.index(row) + self.table_office.insertRow(inx) + self.table_office.setItem(inx, 0, QtWidgets.QTableWidgetItem(row[0])) + self.table_office.setItem(inx, 1, QtWidgets.QTableWidgetItem(row[1])) + self.table_office.setItem(inx, 2, QtWidgets.QTableWidgetItem(row[2])) + self.table_office.setItem(inx, 3, QtWidgets.QTableWidgetItem(row[3])) + self.table_office.setItem(inx, 4, QtWidgets.QTableWidgetItem(row[4])) diff --git a/src/frontend/gui/sisyphus-gui.py b/src/frontend/gui/sisyphus-gui.py new file mode 100755 index 0000000..1cc4fb6 --- /dev/null +++ b/src/frontend/gui/sisyphus-gui.py @@ -0,0 +1,106 @@ +#!/usr/bin/python3 +import sys, subprocess +from PyQt5 import QtCore, QtGui, QtWidgets, uic + +from accesories import Accesories +from development import Development +from games import Games +from graphics import Graphics +from internet import Internet +from multimedia import Multimedia +from office import Office +from system import System +from local import Local +from everything import Everything + +class Sisyphus(QtWidgets.QMainWindow): + def __init__(self): + super(Sisyphus, self).__init__() + uic.loadUi('ui/sisyphus-gui.ui', self) + self.centerOnScreen() + self.show() + + self.package_search.clicked.connect(self.search_package) + self.package_install.clicked.connect(self.install_package) + self.package_uninstall.clicked.connect(self.uninstall_package) + self.system_upgrade.clicked.connect(self.upgrade_system) + self.orphans_remove.clicked.connect(self.remove_orphans) + + self.category_accesories.clicked.connect(self.accesories_category) + self.category_development.clicked.connect(self.development_category) + self.category_games.clicked.connect(self.games_category) + self.category_graphics.clicked.connect(self.graphics_category) + self.category_internet.clicked.connect(self.internet_category) + self.category_multimedia.clicked.connect(self.multimedia_category) + self.category_office.clicked.connect(self.office_category) + self.category_system.clicked.connect(self.system_category) + self.category_local.clicked.connect(self.local_category) + self.category_everything.clicked.connect(self.everything_category) + + def centerOnScreen (self): + resolution = QtWidgets.QDesktopWidget().screenGeometry() + self.move((resolution.width() / 2) - (self.frameSize().width() / 2), + (resolution.height() / 2) - (self.frameSize().height() / 2)) + + def search_package(self): + pkgname = self.input.text() + subprocess.Popen(['xterm', '-hold', '-e', 'sisyphus', 'search'] + pkgname.split()) + + def install_package(self): + pkgname = self.input.text() + subprocess.Popen(['xterm', '-e', 'sisyphus', 'auto-install'] + pkgname.split()) + + def uninstall_package(self): + pkgname = self.input.text() + subprocess.Popen(['xterm', '-e', 'sisyphus', 'auto-uninstall'] + pkgname.split()) + + def upgrade_system(self): + subprocess.Popen(['xterm', '-e', 'sisyphus', 'autoupgrade']) + + def remove_orphans(self): + subprocess.Popen(['xterm', '-e', 'sisyphus', 'remove-orphans']) + + def accesories_category(self): + self.window = Accesories() + self.window.show() + + def development_category(self): + self.window = Development() + self.window.show() + + def games_category(self): + self.window = Games() + self.window.show() + + def graphics_category(self): + self.window = Graphics() + self.window.show() + + def internet_category(self): + self.window = Internet() + self.window.show() + + def multimedia_category(self): + self.window = Multimedia() + self.window.show() + + def office_category(self): + self.window = Office() + self.window.show() + + def system_category(self): + self.window = System() + self.window.show() + + def local_category(self): + self.window = Local() + self.window.show() + + def everything_category(self): + self.window = Everything() + self.window.show() + +if __name__ == '__main__': + app = QtWidgets.QApplication(sys.argv) + window = Sisyphus() + sys.exit(app.exec_()) diff --git a/src/frontend/gui/system.py b/src/frontend/gui/system.py new file mode 100755 index 0000000..f8cc428 --- /dev/null +++ b/src/frontend/gui/system.py @@ -0,0 +1,50 @@ +#!/usr/bin/python3 +import sys, subprocess, sqlite3 +from PyQt5 import QtCore, QtGui, QtWidgets, uic + +class System(QtWidgets.QMainWindow): + def __init__(self): + super(System, self).__init__() + uic.loadUi('ui/system.ui', self) + self.centerOnScreen() + self.show() + self.load_packages() + + self.package_install.clicked.connect(self.install_package) + self.package_uninstall.clicked.connect(self.uninstall_package) + self.orphans_remove.clicked.connect(self.remove_orphans) + self.category_exit.clicked.connect(self.exit_category) + + def centerOnScreen(self): + resolution = QtWidgets.QDesktopWidget().screenGeometry() + self.move((resolution.width() / 2) - (self.frameSize().width() / 2), + (resolution.height() / 2) - (self.frameSize().height() / 2)) + + def install_package(self): + pkgname = self.table_system.item(self.table_system.currentRow(), 1).text() + subprocess.Popen(['xterm', '-e', 'sisyphus', 'auto-install'] + pkgname.split()) + + def uninstall_package(self): + pkgname = self.table_system.item(self.table_system.currentRow(), 1).text() + subprocess.Popen(['xterm', '-e', 'sisyphus', 'auto-uninstall'] + pkgname.split()) + + def remove_orphans(self): + subprocess.Popen(['xterm', '-e', 'sisyphus', 'remove-orphans']) + + def exit_category(self): + self.close() + + def load_packages(self): + with sqlite3.connect('/var/lib/sisyphus/db/sisyphus.db') as db: + cursor=db.cursor() + cursor.execute('''SELECT * from remote_packages''') + rows = cursor.fetchall() + + for row in rows: + inx = rows.index(row) + self.table_system.insertRow(inx) + self.table_system.setItem(inx, 0, QtWidgets.QTableWidgetItem(row[0])) + self.table_system.setItem(inx, 1, QtWidgets.QTableWidgetItem(row[1])) + self.table_system.setItem(inx, 2, QtWidgets.QTableWidgetItem(row[2])) + self.table_system.setItem(inx, 3, QtWidgets.QTableWidgetItem(row[3])) + self.table_system.setItem(inx, 4, QtWidgets.QTableWidgetItem(row[4])) diff --git a/src/frontend/gui/ui/accesories.ui b/src/frontend/gui/ui/accesories.ui new file mode 100644 index 0000000..ea9e495 --- /dev/null +++ b/src/frontend/gui/ui/accesories.ui @@ -0,0 +1,220 @@ + + + Accesories + + + Qt::ApplicationModal + + + + 0 + 0 + 1000 + 600 + + + + + 0 + 0 + + + + + 1000 + 600 + + + + Sisyphus : Category Accesories + + + + ../icon/category_accessories.png../icon/category_accessories.png + + + + + 25 + 25 + 950 + 475 + + + + + 950 + 500 + + + + QFrame::Panel + + + QFrame::Raised + + + QAbstractScrollArea::AdjustToContents + + + QAbstractItemView::NoEditTriggers + + + false + + + QAbstractItemView::SingleSelection + + + QAbstractItemView::SelectRows + + + true + + + 110 + + + true + + + false + + + + Category + + + + + Name + + + + + Available Version + + + + + Installed Version + + + + + Description + + + + + + + 275 + 530 + 200 + 40 + + + + <html><head/><body><p align="center">Uninstall package</p></body></html> + + + + + + + ../icon/package_uninstall.png../icon/package_uninstall.png + + + + 32 + 32 + + + + + + + 525 + 530 + 200 + 40 + + + + <html><head/><body><p align="center">Remove orphan packages</p></body></html> + + + + + + + ../icon/remove_orphans.png../icon/remove_orphans.png + + + + 32 + 32 + + + + + + + 775 + 530 + 200 + 40 + + + + <html><head/><body><p align="center">Close window</p></body></html> + + + + ../icon/window_close.png../icon/window_close.png + + + + 32 + 32 + + + + + + + 25 + 530 + 200 + 40 + + + + <html><head/><body><p align="center">Install package</p></body></html> + + + + + + + ../icon/package_install.png../icon/package_install.png + + + + 32 + 32 + + + + + + table_accesories + package_install + package_uninstall + orphans_remove + category_exit + + + + diff --git a/src/frontend/gui/ui/development.ui b/src/frontend/gui/ui/development.ui new file mode 100644 index 0000000..4c102f1 --- /dev/null +++ b/src/frontend/gui/ui/development.ui @@ -0,0 +1,220 @@ + + + Development + + + Qt::ApplicationModal + + + + 0 + 0 + 1000 + 600 + + + + + 0 + 0 + + + + + 1000 + 600 + + + + Sisyphus : Category Development + + + + ../icon/category_development.png../icon/category_development.png + + + + + 25 + 25 + 950 + 475 + + + + + 950 + 500 + + + + QFrame::Panel + + + QFrame::Raised + + + QAbstractScrollArea::AdjustToContents + + + QAbstractItemView::NoEditTriggers + + + false + + + QAbstractItemView::SingleSelection + + + QAbstractItemView::SelectRows + + + true + + + 110 + + + true + + + false + + + + Category + + + + + Name + + + + + Available Version + + + + + Installed Version + + + + + Description + + + + + + + 275 + 530 + 200 + 40 + + + + <html><head/><body><p align="center">Uninstall package</p></body></html> + + + + + + + ../icon/package_uninstall.png../icon/package_uninstall.png + + + + 32 + 32 + + + + + + + 525 + 530 + 200 + 40 + + + + <html><head/><body><p align="center">Remove orphan packages</p></body></html> + + + + + + + ../icon/remove_orphans.png../icon/remove_orphans.png + + + + 32 + 32 + + + + + + + 775 + 530 + 200 + 40 + + + + <html><head/><body><p align="center">Close window</p></body></html> + + + + ../icon/window_close.png../icon/window_close.png + + + + 32 + 32 + + + + + + + 25 + 530 + 200 + 40 + + + + <html><head/><body><p align="center">Install package</p></body></html> + + + + + + + ../icon/package_install.png../icon/package_install.png + + + + 32 + 32 + + + + + + table_development + package_install + package_uninstall + orphans_remove + category_exit + + + + diff --git a/src/frontend/gui/ui/everything.ui b/src/frontend/gui/ui/everything.ui new file mode 100644 index 0000000..b609cee --- /dev/null +++ b/src/frontend/gui/ui/everything.ui @@ -0,0 +1,220 @@ + + + Everything + + + Qt::ApplicationModal + + + + 0 + 0 + 1000 + 600 + + + + + 0 + 0 + + + + + 1000 + 600 + + + + Sisyphus : All Packages + + + + ../icon/category_all.png../icon/category_all.png + + + + + 25 + 25 + 950 + 475 + + + + + 950 + 500 + + + + QFrame::Panel + + + QFrame::Raised + + + QAbstractScrollArea::AdjustToContents + + + QAbstractItemView::NoEditTriggers + + + false + + + QAbstractItemView::SingleSelection + + + QAbstractItemView::SelectRows + + + true + + + 110 + + + true + + + false + + + + Category + + + + + Name + + + + + Available Version + + + + + Installed Version + + + + + Description + + + + + + + 275 + 530 + 200 + 40 + + + + <html><head/><body><p align="center">Uninstall package</p></body></html> + + + + + + + ../icon/package_uninstall.png../icon/package_uninstall.png + + + + 32 + 32 + + + + + + + 525 + 530 + 200 + 40 + + + + <html><head/><body><p align="center">Remove orphan packages</p></body></html> + + + + + + + ../icon/remove_orphans.png../icon/remove_orphans.png + + + + 32 + 32 + + + + + + + 775 + 530 + 200 + 40 + + + + <html><head/><body><p align="center">Close window</p></body></html> + + + + ../icon/window_close.png../icon/window_close.png + + + + 32 + 32 + + + + + + + 25 + 530 + 200 + 40 + + + + <html><head/><body><p align="center">Install package</p></body></html> + + + + + + + ../icon/package_install.png../icon/package_install.png + + + + 32 + 32 + + + + + + table_everything + package_install + package_uninstall + orphans_remove + category_exit + + + + diff --git a/src/frontend/gui/ui/games.ui b/src/frontend/gui/ui/games.ui new file mode 100644 index 0000000..0bbc787 --- /dev/null +++ b/src/frontend/gui/ui/games.ui @@ -0,0 +1,220 @@ + + + Games + + + Qt::ApplicationModal + + + + 0 + 0 + 1000 + 600 + + + + + 0 + 0 + + + + + 1000 + 600 + + + + Sisyphus : Category Games + + + + ../icon/category_games.png../icon/category_games.png + + + + + 25 + 25 + 950 + 475 + + + + + 950 + 500 + + + + QFrame::Panel + + + QFrame::Raised + + + QAbstractScrollArea::AdjustToContents + + + QAbstractItemView::NoEditTriggers + + + false + + + QAbstractItemView::SingleSelection + + + QAbstractItemView::SelectRows + + + true + + + 110 + + + true + + + false + + + + Category + + + + + Name + + + + + Available Version + + + + + Installed Version + + + + + Description + + + + + + + 275 + 530 + 200 + 40 + + + + <html><head/><body><p align="center">Uninstall package</p></body></html> + + + + + + + ../icon/package_uninstall.png../icon/package_uninstall.png + + + + 32 + 32 + + + + + + + 525 + 530 + 200 + 40 + + + + <html><head/><body><p align="center">Remove orphan packages</p></body></html> + + + + + + + ../icon/remove_orphans.png../icon/remove_orphans.png + + + + 32 + 32 + + + + + + + 775 + 530 + 200 + 40 + + + + <html><head/><body><p align="center">Close window</p></body></html> + + + + ../icon/window_close.png../icon/window_close.png + + + + 32 + 32 + + + + + + + 25 + 530 + 200 + 40 + + + + <html><head/><body><p align="center">Install package</p></body></html> + + + + + + + ../icon/package_install.png../icon/package_install.png + + + + 32 + 32 + + + + + + table_games + package_install + package_uninstall + orphans_remove + category_exit + + + + diff --git a/src/frontend/gui/ui/graphics.ui b/src/frontend/gui/ui/graphics.ui new file mode 100644 index 0000000..e943b49 --- /dev/null +++ b/src/frontend/gui/ui/graphics.ui @@ -0,0 +1,220 @@ + + + Graphics + + + Qt::ApplicationModal + + + + 0 + 0 + 1000 + 600 + + + + + 0 + 0 + + + + + 1000 + 600 + + + + Sisyphus : Category Graphics + + + + ../icon/category_graphics.png../icon/category_graphics.png + + + + + 25 + 25 + 950 + 475 + + + + + 950 + 500 + + + + QFrame::Panel + + + QFrame::Raised + + + QAbstractScrollArea::AdjustToContents + + + QAbstractItemView::NoEditTriggers + + + false + + + QAbstractItemView::SingleSelection + + + QAbstractItemView::SelectRows + + + true + + + 110 + + + true + + + false + + + + Category + + + + + Name + + + + + Available Version + + + + + Installed Version + + + + + Description + + + + + + + 275 + 530 + 200 + 40 + + + + <html><head/><body><p align="center">Uninstall package</p></body></html> + + + + + + + ../icon/package_uninstall.png../icon/package_uninstall.png + + + + 32 + 32 + + + + + + + 525 + 530 + 200 + 40 + + + + <html><head/><body><p align="center">Remove orphan packages</p></body></html> + + + + + + + ../icon/remove_orphans.png../icon/remove_orphans.png + + + + 32 + 32 + + + + + + + 775 + 530 + 200 + 40 + + + + <html><head/><body><p align="center">Close window</p></body></html> + + + + ../icon/window_close.png../icon/window_close.png + + + + 32 + 32 + + + + + + + 25 + 530 + 200 + 40 + + + + <html><head/><body><p align="center">Install package</p></body></html> + + + + + + + ../icon/package_install.png../icon/package_install.png + + + + 32 + 32 + + + + + + table_graphics + package_install + package_uninstall + orphans_remove + category_exit + + + + diff --git a/src/frontend/gui/ui/internet.ui b/src/frontend/gui/ui/internet.ui new file mode 100644 index 0000000..810c065 --- /dev/null +++ b/src/frontend/gui/ui/internet.ui @@ -0,0 +1,220 @@ + + + Internet + + + Qt::ApplicationModal + + + + 0 + 0 + 1000 + 600 + + + + + 0 + 0 + + + + + 1000 + 600 + + + + Sisyphus : Category Internet + + + + ../icon/category_internet.png../icon/category_internet.png + + + + + 25 + 25 + 950 + 475 + + + + + 950 + 500 + + + + QFrame::Panel + + + QFrame::Raised + + + QAbstractScrollArea::AdjustToContents + + + QAbstractItemView::NoEditTriggers + + + false + + + QAbstractItemView::SingleSelection + + + QAbstractItemView::SelectRows + + + true + + + 110 + + + true + + + false + + + + Category + + + + + Name + + + + + Available Version + + + + + Installed Version + + + + + Description + + + + + + + 275 + 530 + 200 + 40 + + + + <html><head/><body><p align="center">Uninstall package</p></body></html> + + + + + + + ../icon/package_uninstall.png../icon/package_uninstall.png + + + + 32 + 32 + + + + + + + 525 + 530 + 200 + 40 + + + + <html><head/><body><p align="center">Remove orphan packages</p></body></html> + + + + + + + ../icon/remove_orphans.png../icon/remove_orphans.png + + + + 32 + 32 + + + + + + + 775 + 530 + 200 + 40 + + + + <html><head/><body><p align="center">Close window</p></body></html> + + + + ../icon/window_close.png../icon/window_close.png + + + + 32 + 32 + + + + + + + 25 + 530 + 200 + 40 + + + + <html><head/><body><p align="center">Install package</p></body></html> + + + + + + + ../icon/package_install.png../icon/package_install.png + + + + 32 + 32 + + + + + + table_internet + package_install + package_uninstall + orphans_remove + category_exit + + + + diff --git a/src/frontend/gui/ui/local.ui b/src/frontend/gui/ui/local.ui new file mode 100644 index 0000000..46cd6f9 --- /dev/null +++ b/src/frontend/gui/ui/local.ui @@ -0,0 +1,217 @@ + + + Local + + + Qt::ApplicationModal + + + + 0 + 0 + 1000 + 600 + + + + + 0 + 0 + + + + + 1000 + 600 + + + + Sisyphus : Local Packages + + + + ../icon/category_local.png../icon/category_local.png + + + + + 25 + 25 + 950 + 475 + + + + + 950 + 500 + + + + QFrame::Panel + + + QFrame::Raised + + + QAbstractScrollArea::AdjustToContents + + + QAbstractItemView::NoEditTriggers + + + false + + + QAbstractItemView::SingleSelection + + + QAbstractItemView::SelectRows + + + true + + + true + + + false + + + + Category + + + + + Name + + + + + Version + + + + + Slot + + + + + Description + + + + + + + 275 + 530 + 200 + 40 + + + + <html><head/><body><p align="center">Uninstall package</p></body></html> + + + + + + + ../icon/package_uninstall.png../icon/package_uninstall.png + + + + 32 + 32 + + + + + + + 525 + 530 + 200 + 40 + + + + <html><head/><body><p align="center">Remove orphan packages</p></body></html> + + + + + + + ../icon/remove_orphans.png../icon/remove_orphans.png + + + + 32 + 32 + + + + + + + 775 + 530 + 200 + 40 + + + + <html><head/><body><p align="center">Close window</p></body></html> + + + + ../icon/window_close.png../icon/window_close.png + + + + 32 + 32 + + + + + + + 25 + 530 + 200 + 40 + + + + <html><head/><body><p align="center">Install package</p></body></html> + + + + + + + ../icon/package_install.png../icon/package_install.png + + + + 32 + 32 + + + + + + table_local + package_install + package_uninstall + orphans_remove + category_exit + + + + diff --git a/src/frontend/gui/ui/multimedia.ui b/src/frontend/gui/ui/multimedia.ui new file mode 100644 index 0000000..b2c4938 --- /dev/null +++ b/src/frontend/gui/ui/multimedia.ui @@ -0,0 +1,220 @@ + + + Multimedia + + + Qt::ApplicationModal + + + + 0 + 0 + 1000 + 600 + + + + + 0 + 0 + + + + + 1000 + 600 + + + + Sisyphus : Category Multimedia + + + + ../icon/category_multimedia.png../icon/category_multimedia.png + + + + + 25 + 25 + 950 + 475 + + + + + 950 + 500 + + + + QFrame::Panel + + + QFrame::Raised + + + QAbstractScrollArea::AdjustToContents + + + QAbstractItemView::NoEditTriggers + + + false + + + QAbstractItemView::SingleSelection + + + QAbstractItemView::SelectRows + + + true + + + 110 + + + true + + + false + + + + Category + + + + + Name + + + + + Available Version + + + + + Installed Version + + + + + Description + + + + + + + 275 + 530 + 200 + 40 + + + + <html><head/><body><p align="center">Uninstall package</p></body></html> + + + + + + + ../icon/package_uninstall.png../icon/package_uninstall.png + + + + 32 + 32 + + + + + + + 525 + 530 + 200 + 40 + + + + <html><head/><body><p align="center">Remove orphan packages</p></body></html> + + + + + + + ../icon/remove_orphans.png../icon/remove_orphans.png + + + + 32 + 32 + + + + + + + 775 + 530 + 200 + 40 + + + + <html><head/><body><p align="center">Close window</p></body></html> + + + + ../icon/window_close.png../icon/window_close.png + + + + 32 + 32 + + + + + + + 25 + 530 + 200 + 40 + + + + <html><head/><body><p align="center">Install package</p></body></html> + + + + + + + ../icon/package_install.png../icon/package_install.png + + + + 32 + 32 + + + + + + table_multimedia + package_install + package_uninstall + orphans_remove + category_exit + + + + diff --git a/src/frontend/gui/ui/office.ui b/src/frontend/gui/ui/office.ui new file mode 100644 index 0000000..d1d3bad --- /dev/null +++ b/src/frontend/gui/ui/office.ui @@ -0,0 +1,220 @@ + + + Office + + + Qt::ApplicationModal + + + + 0 + 0 + 1000 + 600 + + + + + 0 + 0 + + + + + 1000 + 600 + + + + Sisyphus : Category Office + + + + ../icon/category_office.png../icon/category_office.png + + + + + 25 + 25 + 950 + 475 + + + + + 950 + 500 + + + + QFrame::Panel + + + QFrame::Raised + + + QAbstractScrollArea::AdjustToContents + + + QAbstractItemView::NoEditTriggers + + + false + + + QAbstractItemView::SingleSelection + + + QAbstractItemView::SelectRows + + + true + + + 110 + + + true + + + false + + + + Category + + + + + Name + + + + + Available Version + + + + + Installed Version + + + + + Description + + + + + + + 275 + 530 + 200 + 40 + + + + <html><head/><body><p align="center">Uninstall package</p></body></html> + + + + + + + ../icon/package_uninstall.png../icon/package_uninstall.png + + + + 32 + 32 + + + + + + + 525 + 530 + 200 + 40 + + + + <html><head/><body><p align="center">Remove orphan packages</p></body></html> + + + + + + + ../icon/remove_orphans.png../icon/remove_orphans.png + + + + 32 + 32 + + + + + + + 775 + 530 + 200 + 40 + + + + <html><head/><body><p align="center">Close window</p></body></html> + + + + ../icon/window_close.png../icon/window_close.png + + + + 32 + 32 + + + + + + + 25 + 530 + 200 + 40 + + + + <html><head/><body><p align="center">Install package</p></body></html> + + + + + + + ../icon/package_install.png../icon/package_install.png + + + + 32 + 32 + + + + + + table_office + package_install + package_uninstall + orphans_remove + category_exit + + + + diff --git a/src/frontend/gui/ui/sisyphus-gui.ui b/src/frontend/gui/ui/sisyphus-gui.ui new file mode 100644 index 0000000..0d6749c --- /dev/null +++ b/src/frontend/gui/ui/sisyphus-gui.ui @@ -0,0 +1,520 @@ + + + MainWindow + + + + 0 + 0 + 1000 + 600 + + + + + 0 + 0 + + + + + 1000 + 600 + + + + Sisyphus : Graphical User Interface + + + + ../icon/window_icon.png../icon/window_icon.png + + + Qt::LeftToRight + + + true + + + + + 0 + 0 + + + + + + 0 + 0 + 1000 + 200 + + + + + 0 + 0 + + + + Qt::LeftToRight + + + true + + + QFrame::NoFrame + + + QFrame::Plain + + + + + 100 + 30 + 800 + 40 + + + + + 0 + 0 + + + + <html><head/><body><p align="center">Enter package name you want to Search/Install/Uninstall</p></body></html> + + + Enter package name... + + + true + + + Qt::AlignJustify|Qt::AlignVCenter + + + true + + + + + + 215 + 105 + 190 + 40 + + + + + 0 + 0 + + + + <html><head/><body><p align="center">Install package(s)</p></body></html> + + + + ../icon/package_install.png../icon/package_install.png + + + + 32 + 32 + + + + + + + 25 + 105 + 190 + 40 + + + + + 0 + 0 + + + + <html><head/><body><p align="center">Search package(s)</p></body></html> + + + + ../icon/package_search.png../icon/package_search.png + + + + 32 + 32 + + + + + + + 405 + 105 + 190 + 40 + + + + + 0 + 0 + + + + <html><head/><body><p align="center">Uninstall package(s)</p></body></html> + + + + ../icon/package_uninstall.png../icon/package_uninstall.png + + + + 32 + 32 + + + + + + + 595 + 105 + 190 + 40 + + + + + 0 + 0 + + + + <html><head/><body><p align="center">Upgrade system</p></body></html> + + + + ../icon/system_upgrade.png../icon/system_upgrade.png + + + + 32 + 32 + + + + + + + 785 + 105 + 190 + 40 + + + + + 0 + 0 + + + + <html><head/><body><p align="center">Remove orphan packages</p></body></html> + + + + ../icon/remove_orphans.png../icon/remove_orphans.png + + + + 32 + 32 + + + + + + + + 0 + 200 + 1000 + 400 + + + + QFrame::NoFrame + + + QFrame::Plain + + + + + 25 + 20 + 150 + 150 + + + + <html><head/><body><p align="center">Browse Accesories Category</p></body></html> + + + + ../icon/category_accessories.png../icon/category_accessories.png + + + + 64 + 64 + + + + + + + 425 + 20 + 150 + 150 + + + + <html><head/><body><p align="center">Browse Games Category</p></body></html> + + + + ../icon/category_games.png../icon/category_games.png + + + + 64 + 64 + + + + + + + 625 + 20 + 150 + 150 + + + + <html><head/><body><p align="center">Browse Graphics Category</p></body></html> + + + + ../icon/category_graphics.png../icon/category_graphics.png + + + + 64 + 64 + + + + + + + 825 + 20 + 150 + 150 + + + + <html><head/><body><p align="center">Browse Internet Category</p></body></html> + + + + ../icon/category_internet.png../icon/category_internet.png + + + + 64 + 64 + + + + + + + 25 + 215 + 150 + 150 + + + + <html><head/><body><p align="center">Browse Multimedia Category</p></body></html> + + + + ../icon/category_multimedia.png../icon/category_multimedia.png + + + + 64 + 64 + + + + + + + 225 + 215 + 150 + 150 + + + + <html><head/><body><p align="center">Browse Office Category</p></body></html> + + + + ../icon/category_office.png../icon/category_office.png + + + + 64 + 64 + + + + + + + 425 + 215 + 150 + 150 + + + + <html><head/><body><p align="center">Browse System Category</p></body></html> + + + + ../icon/category_system.png../icon/category_system.png + + + + 64 + 64 + + + + + + + 225 + 20 + 150 + 150 + + + + <html><head/><body><p align="center">Browse Development Category</p></body></html> + + + + ../icon/category_development.png../icon/category_development.png + + + + 64 + 64 + + + + + + + 625 + 215 + 150 + 150 + + + + <html><head/><body><p align="center">Browse All Packages</p></body></html> + + + + ../icon/category_all.png../icon/category_all.png + + + + 64 + 64 + + + + + + + 825 + 215 + 150 + 150 + + + + <html><head/><body><p align="center">Browse Installed Packages</p></body></html> + + + + + + + ../icon/category_local.png../icon/category_local.png + + + + 64 + 64 + + + + + + + + input + package_search + package_install + package_uninstall + system_upgrade + orphans_remove + category_accesories + category_development + category_games + category_graphics + category_internet + category_multimedia + category_office + category_system + category_local + category_everything + + + + diff --git a/src/frontend/gui/ui/system.ui b/src/frontend/gui/ui/system.ui new file mode 100644 index 0000000..59f1967 --- /dev/null +++ b/src/frontend/gui/ui/system.ui @@ -0,0 +1,220 @@ + + + System + + + Qt::ApplicationModal + + + + 0 + 0 + 1000 + 600 + + + + + 0 + 0 + + + + + 1000 + 600 + + + + Sisyphus : Category System + + + + ../icon/category_system.png../icon/category_system.png + + + + + 25 + 25 + 950 + 475 + + + + + 950 + 500 + + + + QFrame::Panel + + + QFrame::Raised + + + QAbstractScrollArea::AdjustToContents + + + QAbstractItemView::NoEditTriggers + + + false + + + QAbstractItemView::SingleSelection + + + QAbstractItemView::SelectRows + + + true + + + 110 + + + true + + + false + + + + Category + + + + + Name + + + + + Available Version + + + + + Installed Version + + + + + Description + + + + + + + 275 + 530 + 200 + 40 + + + + <html><head/><body><p align="center">Uninstall package</p></body></html> + + + + + + + ../icon/package_uninstall.png../icon/package_uninstall.png + + + + 32 + 32 + + + + + + + 525 + 530 + 200 + 40 + + + + <html><head/><body><p align="center">Remove orphan packages</p></body></html> + + + + + + + ../icon/remove_orphans.png../icon/remove_orphans.png + + + + 32 + 32 + + + + + + + 775 + 530 + 200 + 40 + + + + <html><head/><body><p align="center">Close window</p></body></html> + + + + ../icon/window_close.png../icon/window_close.png + + + + 32 + 32 + + + + + + + 25 + 530 + 200 + 40 + + + + <html><head/><body><p align="center">Install package</p></body></html> + + + + + + + ../icon/package_install.png../icon/package_install.png + + + + 32 + 32 + + + + + + table_system + package_install + package_uninstall + orphans_remove + category_exit + + + + diff --git a/src/helpers/make_local_csv_post b/src/helpers/make_local_csv_post new file mode 100755 index 0000000..cd38974 --- /dev/null +++ b/src/helpers/make_local_csv_post @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +collect_local_portage_database() { + for i in $(qlist -ICv); do + pushd /var/db/pkg/$i > /dev/null 2>&1 + echo "$(> /tmp/local_postinst.csv + popd > /dev/null 2>&1 + done + mv /tmp/local_postinst.csv /var/lib/sisyphus/csv/ +} + +clean_temporary_files() { + rm -rf /tmp/local_postinst.csv +} + +main() { + collect_local_portage_database + clean_temporary_files +} + +main diff --git a/src/helpers/make_local_csv_pre b/src/helpers/make_local_csv_pre new file mode 100755 index 0000000..068331e --- /dev/null +++ b/src/helpers/make_local_csv_pre @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +collect_local_portage_database() { + for i in $(qlist -ICv); do + pushd /var/db/pkg/$i > /dev/null 2>&1 + echo "$(> /tmp/local_preinst.csv + popd > /dev/null 2>&1 + done + mv /tmp/local_preinst.csv /var/lib/sisyphus/csv/ +} + +clean_temporary_files() { + rm -rf /tmp/local_preinst.csv +} + +main() { + collect_local_portage_database + clean_temporary_files +} + +main -- cgit v1.2.3