From 5ad7c7f13b1ce3aab53c0e7bdbfa8ad7a3298d2d Mon Sep 17 00:00:00 2001 From: vcatafesta Date: Thu, 24 Aug 2023 00:47:54 -0400 Subject: [PATCH] qui 24 ago 2023 00:47:54 -04 Vilmar Catafesta (vcatafesta@gmail.com) --- .../bcc/apps/big-store/config.sh.htm | 18 +- .../bcc/apps/big-store/header.sh.htm | 10 +- .../bcc/apps/big-store/index.sh.htm | 12 +- .../bcc/apps/big-store/info_snap.sh.htm | 6 +- .../bigbashview/bcc/apps/big-store/load.sh | 14 +- .../bcc/apps/big-store/pkg_pacman_build_date | 4 - .../apps/big-store/pkg_pacman_install_date | 6 - .../apps/big-store/pkg_pacman_install_reason | 6 - .../bcc/apps/big-store/pkg_pacman_version | 4 - .../share/bigbashview/bcc/apps/big-store/temp | 0 .../bcc/apps/big-store/view_appstream.sh.htm | 8 +- .../apps/big-store/view_appstream_pamac.py | 584 ++++++++++++------ .../bcc/apps/big-store/view_aur.py | 11 +- .../bcc/apps/big-store/view_flatpak.sh.htm | 8 +- .../bcc/apps/big-store/view_snap.sh.htm | 8 +- 15 files changed, 443 insertions(+), 256 deletions(-) delete mode 100755 big-store/usr/share/bigbashview/bcc/apps/big-store/pkg_pacman_build_date delete mode 100755 big-store/usr/share/bigbashview/bcc/apps/big-store/pkg_pacman_install_date delete mode 100755 big-store/usr/share/bigbashview/bcc/apps/big-store/pkg_pacman_install_reason delete mode 100755 big-store/usr/share/bigbashview/bcc/apps/big-store/pkg_pacman_version delete mode 100644 big-store/usr/share/bigbashview/bcc/apps/big-store/temp diff --git a/big-store/usr/share/bigbashview/bcc/apps/big-store/config.sh.htm b/big-store/usr/share/bigbashview/bcc/apps/big-store/config.sh.htm index afd6a6397..1b8b80434 100755 --- a/big-store/usr/share/bigbashview/bcc/apps/big-store/config.sh.htm +++ b/big-store/usr/share/bigbashview/bcc/apps/big-store/config.sh.htm @@ -6,7 +6,7 @@ # Description: Big Store installing programs for BigLinux # # Created: 2022/11/01 -# Altered: 2023/08/16 +# Altered: 2023/08/24 # # Copyright (c) 2023-2023, Vilmar Catafesta # 2022-2023, Bruno Gonçalves @@ -34,7 +34,7 @@ # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. APP="${0##*/}" -_VERSION_="1.0.0-20230816" +_VERSION_="1.0.0-20230824" LIBRARY=${LIBRARY:-'/usr/share/bigbashview/bcc/shell'} BOOTLOG="/tmp/bigstore-$USER-$(date +"%d%m%Y").log" LOGGER='/dev/tty8' @@ -96,13 +96,13 @@ pacman -Qu | cut -f1 -d" " >>"$tmp_file_upgradeable" fi - [[ "$update_pacman" = "y" ]] && sh_run_action "update_pacman" - [[ "$update_mirror" = "y" ]] && sh_run_action "update_mirror" - [[ "$update_keys" = "y" ]] && sh_run_action "update_keys" - [[ "$force_upgrade" = "y" ]] && sh_run_action "force_upgrade" - [[ "$reinstall_allpkg" = "y" ]] && sh_run_action "reinstall_allpkg" - [[ "$system_upgrade" = "y" ]] && sh_run_action "system_upgrade" - [[ "$system_upgradetotal" = "y" ]] && sh_run_action "system_upgradetotal" + [[ "$update_pacman" = "y" ]] && sh_run_action "update_pacman" "$WINDOW_ID" "$PACKAGE_NAME" "$PACKAGE_ID" "$REPOSITORY" "$DRIVER" + [[ "$update_mirror" = "y" ]] && sh_run_action "update_mirror" "$WINDOW_ID" "$PACKAGE_NAME" "$PACKAGE_ID" "$REPOSITORY" "$DRIVER" + [[ "$update_keys" = "y" ]] && sh_run_action "update_keys" "$WINDOW_ID" "$PACKAGE_NAME" "$PACKAGE_ID" "$REPOSITORY" "$DRIVER" + [[ "$force_upgrade" = "y" ]] && sh_run_action "force_upgrade" "$WINDOW_ID" "$PACKAGE_NAME" "$PACKAGE_ID" "$REPOSITORY" "$DRIVER" + [[ "$reinstall_allpkg" = "y" ]] && sh_run_action "reinstall_allpkg" "$WINDOW_ID" "$PACKAGE_NAME" "$PACKAGE_ID" "$REPOSITORY" "$DRIVER" + [[ "$system_upgrade" = "y" ]] && sh_run_action "system_upgrade" "$WINDOW_ID" "$PACKAGE_NAME" "$PACKAGE_ID" "$REPOSITORY" "$DRIVER" + [[ "$system_upgradetotal" = "y" ]] && sh_run_action "system_upgradetotal" "$WINDOW_ID" "$PACKAGE_NAME" "$PACKAGE_ID" "$REPOSITORY" "$DRIVER" cat <<-EOF
diff --git a/big-store/usr/share/bigbashview/bcc/apps/big-store/header.sh.htm b/big-store/usr/share/bigbashview/bcc/apps/big-store/header.sh.htm index 244b355d0..fdf5b7b4c 100755 --- a/big-store/usr/share/bigbashview/bcc/apps/big-store/header.sh.htm +++ b/big-store/usr/share/bigbashview/bcc/apps/big-store/header.sh.htm @@ -6,7 +6,7 @@ # Description: Control Center to help usage of BigLinux # # Created: 2020/11/01 -# Altered: 2023/08/18 +# Altered: 2023/08/24 # # Copyright (c) 2023-2023, Vilmar Catafesta # 2022-2023, Bruno Gonçalves @@ -34,7 +34,7 @@ # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. APP="${0##*/}" -_VERSION_="1.0.0-20230818" +_VERSION_="1.0.0-20230824" export BOOTLOG="/tmp/bigstore-$USER-$(date +"%d%m%Y").log" export LOGGER='/dev/tty8' export HOME_FOLDER="$HOME/.bigstore" @@ -83,7 +83,7 @@ e oculta resultados que são úteis
apenas a usuários avançados." - declare -g TYPE_SEARCH=$"Procurar programa" + declare -g TYPE_SEARCH=$"Procurar aplicativo" declare -g MODE_SIMPLE=$"Modo Simplificado" declare -g Nativos_text=$"Nativos" declare -g ProgressMessage=$"Aplicando - Aguarde" @@ -577,9 +577,9 @@ Aur -
+
-
+
EOF diff --git a/big-store/usr/share/bigbashview/bcc/apps/big-store/index.sh.htm b/big-store/usr/share/bigbashview/bcc/apps/big-store/index.sh.htm index 44587a34c..b9ce6af33 100755 --- a/big-store/usr/share/bigbashview/bcc/apps/big-store/index.sh.htm +++ b/big-store/usr/share/bigbashview/bcc/apps/big-store/index.sh.htm @@ -6,7 +6,7 @@ # Description: Big Store installing programs for BigLinux # # Created: 2020/01/11 -# Altered: 2023/08/18 +# Altered: 2023/08/24 # # Copyright (c) 2023-2023, Vilmar Catafesta # 2022-2023, Bruno Gonçalves @@ -34,7 +34,7 @@ # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. APP="${0##*/}" -_VERSION_="1.0.0-20230818" +_VERSION_="1.0.0-20230824" export BOOTLOG="/tmp/bigstore-$USER-$(date +"%d%m%Y").log" export LOGGER='/dev/tty8' export TMP_FOLDER="/tmp/bigstore-$USER" @@ -124,6 +124,7 @@ fi cat <<-EOF +
EOF @@ -143,10 +144,9 @@
$Programas_Nativos -
- - +
+ EOF pacman -Qu | cut -f1 -d" " >"${TMP_FOLDER}/upgradeable.txt" @@ -154,6 +154,8 @@ cat <<-EOF + +
EOF diff --git a/big-store/usr/share/bigbashview/bcc/apps/big-store/info_snap.sh.htm b/big-store/usr/share/bigbashview/bcc/apps/big-store/info_snap.sh.htm index 29c883bf3..325045291 100755 --- a/big-store/usr/share/bigbashview/bcc/apps/big-store/info_snap.sh.htm +++ b/big-store/usr/share/bigbashview/bcc/apps/big-store/info_snap.sh.htm @@ -6,7 +6,7 @@ # Description: Control Center to help usage of BigLinux # # Created: 2022/02/28 -# Altered: 2023/08/18 +# Altered: 2023/08/24 # # Copyright (c) 2023-2023, Vilmar Catafesta # 2022-2023, Bruno Gonçalves @@ -34,7 +34,7 @@ # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. APP="${0##*/}" -_VERSION_="1.0.0-20230818" +_VERSION_="1.0.0-20230824" export BOOTLOG="/tmp/bigcontrolcenter-$USER-$(date +"%d%m%Y").log" export LOGGER='/dev/tty8' export TMP_FOLDER="/tmp/bigstore-$USER" @@ -68,7 +68,7 @@ if [ "$pkg_remove" = "y" ]; then ACTION="remove_snap" PACKAGE_NAME="$pkg_name" - sh_run_action "$ACTION" + sh_run_action "$ACTION" "$WINDOW_ID" "$PACKAGE_NAME" "$PACKAGE_ID" "$REPOSITORY" "$DRIVER" fi for i in $(snap list | cut -f1 -d" " | tail -n +2); do diff --git a/big-store/usr/share/bigbashview/bcc/apps/big-store/load.sh b/big-store/usr/share/bigbashview/bcc/apps/big-store/load.sh index 68fffb84e..3f335b0fe 100755 --- a/big-store/usr/share/bigbashview/bcc/apps/big-store/load.sh +++ b/big-store/usr/share/bigbashview/bcc/apps/big-store/load.sh @@ -6,7 +6,7 @@ # Description: Control Center to help usage of BigLinux # # Created: 2022/02/28 -# Altered: 2023/08/18 +# Altered: 2023/08/24 # # Copyright (c) 2023-2023, Vilmar Catafesta # 2022-2023, Bruno Gonçalves @@ -34,7 +34,7 @@ # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. APP="${0##*/}" -_VERSION_="1.0.0-20230818" +_VERSION_="1.0.0-20230824" export BOOTLOG="/tmp/bigcontrolcenter-$USER-$(date +"%d%m%Y").log" export LOGGER='/dev/tty8' export HOME_FOLDER="$HOME/.bigstore" @@ -60,22 +60,22 @@ function sh_load_main { local pacote="$2" local paths +xdebug "sh_load_main:$LINENO" + sh_load_config sh_load_refresh_db if [[ -n "$pacote" ]]; then case $1 in pkg_not_installed) - if paths=$(pacman -Flq "$pacote") && [[ -n "$paths" ]]; then - sed 's|^|/|' <<<"$paths" - fi - ;; + pacman -Flq "$2" | sed 's|^|/|' + ;; pkg_installed) pacman -Qk "$pacote" pacman -Qlq "$pacote" ;; pkg_installed_flatpak) echo "Folder base: $(flatpak info --show-location "$pacote")" - find $(flatpak info --show-location "$pacote") | sed "s|$(flatpak info --show-location "$pacote")||g" + find "$(flatpak info --show-location "$pacote")" | sed "s|$(flatpak info --show-location "$pacote")||g" ;; esac else diff --git a/big-store/usr/share/bigbashview/bcc/apps/big-store/pkg_pacman_build_date b/big-store/usr/share/bigbashview/bcc/apps/big-store/pkg_pacman_build_date deleted file mode 100755 index 9c46206e6..000000000 --- a/big-store/usr/share/bigbashview/bcc/apps/big-store/pkg_pacman_build_date +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash - -export TMP_FOLDER="/tmp/bigstore-$USER" -grep "^Build Date " "${TMP_FOLDER}/pacman_pkg_cache.txt" | cut -f2 -d: diff --git a/big-store/usr/share/bigbashview/bcc/apps/big-store/pkg_pacman_install_date b/big-store/usr/share/bigbashview/bcc/apps/big-store/pkg_pacman_install_date deleted file mode 100755 index 3586b2055..000000000 --- a/big-store/usr/share/bigbashview/bcc/apps/big-store/pkg_pacman_install_date +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env bash - -#folders -export HOME_FOLDER="$HOME/.bigstore" -export TMP_FOLDER="/tmp/bigstore-$USER" -grep "^Install Date " "${TMP_FOLDER}/pacman_pkg_cache.txt" | cut -f2 -d: diff --git a/big-store/usr/share/bigbashview/bcc/apps/big-store/pkg_pacman_install_reason b/big-store/usr/share/bigbashview/bcc/apps/big-store/pkg_pacman_install_reason deleted file mode 100755 index 74fed9a3b..000000000 --- a/big-store/usr/share/bigbashview/bcc/apps/big-store/pkg_pacman_install_reason +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env bash - -#folders -export HOME_FOLDER="$HOME/.bigstore" -export TMP_FOLDER="/tmp/bigstore-$USER" -grep "^Install Reason " "${TMP_FOLDER}/pacman_pkg_cache.txt" | cut -f2 -d: diff --git a/big-store/usr/share/bigbashview/bcc/apps/big-store/pkg_pacman_version b/big-store/usr/share/bigbashview/bcc/apps/big-store/pkg_pacman_version deleted file mode 100755 index cef88f072..000000000 --- a/big-store/usr/share/bigbashview/bcc/apps/big-store/pkg_pacman_version +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash - -export TMP_FOLDER="/tmp/bigstore-$USER" -grep "^Version " "${TMP_FOLDER}/pacman_pkg_cache.txt" | cut -f2-10 -d: | awk 'NF' diff --git a/big-store/usr/share/bigbashview/bcc/apps/big-store/temp b/big-store/usr/share/bigbashview/bcc/apps/big-store/temp deleted file mode 100644 index e69de29bb..000000000 diff --git a/big-store/usr/share/bigbashview/bcc/apps/big-store/view_appstream.sh.htm b/big-store/usr/share/bigbashview/bcc/apps/big-store/view_appstream.sh.htm index a3659984e..172a6c763 100755 --- a/big-store/usr/share/bigbashview/bcc/apps/big-store/view_appstream.sh.htm +++ b/big-store/usr/share/bigbashview/bcc/apps/big-store/view_appstream.sh.htm @@ -6,7 +6,7 @@ # Description: Control Center to help usage of BigLinux # # Created: 2022/02/28 -# Altered: 2023/08/18 +# Altered: 2023/08/24 # # Copyright (c) 2023-2023, Vilmar Catafesta # 2022-2023, Bruno Gonçalves @@ -34,7 +34,7 @@ # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. APP="${0##*/}" -_VERSION_="1.0.0-20230818" +_VERSION_="1.0.0-20230824" export BOOTLOG="/tmp/bigcontrolcenter-$USER-$(date +"%d%m%Y").log" export LOGGER='/dev/tty8' export HOME_FOLDER="$HOME/.bigstore" @@ -62,7 +62,9 @@ ACTION="reinstall_pamac" REPOSITORY="$REPOSITORY" PACKAGE_NAME="${pkg_name,,}" - sh_run_action "$ACTION" + PACKAGE_ID="" + WINDOW_ID="" + sh_run_action "$ACTION" "$WINDOW_ID" "$PACKAGE_NAME" "$PACKAGE_ID" "$REPOSITORY" "$DRIVER" pacman -Qu | cut -f1 -d" " >>${TMP_FOLDER}/upgradeable.txt fi diff --git a/big-store/usr/share/bigbashview/bcc/apps/big-store/view_appstream_pamac.py b/big-store/usr/share/bigbashview/bcc/apps/big-store/view_appstream_pamac.py index fbd638221..370e9f896 100755 --- a/big-store/usr/share/bigbashview/bcc/apps/big-store/view_appstream_pamac.py +++ b/big-store/usr/share/bigbashview/bcc/apps/big-store/view_appstream_pamac.py @@ -14,7 +14,7 @@ # coding=utf-8 # -*- coding: utf-8 -*- -#Imported from https://gitlab.manjaro.org/applications/pamac/-/blob/master/examples/python/appstream.py +# Imported from https://gitlab.manjaro.org/applications/pamac/-/blob/master/examples/python/appstream.py import gi import subprocess @@ -22,253 +22,453 @@ import os import locale import datetime -gi.require_version('Pamac', '11') + +gi.require_version("Pamac", "11") from gi.repository import Pamac -# Import gettext module +#biblioteca apresenta erro de segmentação ao ser destruido quando o app é finalizado: destroy gettext import gettext -lang_translations = gettext.translation('big-store', localedir='/usr/share/locale', fallback=True) + +lang_translations = gettext.translation( + "big-store", localedir="/usr/share/locale", fallback=True +) lang_translations.install() # define _ shortcut for translations _ = lang_translations.gettext -TMP_FOLDER = os.environ['TMP_FOLDER'] - -def print_pkg_details (details): - loc = '%d/%m/%Y' if locale.getlocale()[0] == 'pt_BR' else '%Y/%m/%d' - #print (" -Name:", details.get_name()) - #print (" -Desc:", details.get_desc()) - #print (" -Long Desc:", details.get_long_desc()) - #print (" -Icon:", details.get_icon()) - #print (" -Screenshots:", details.get_screenshots()) - #print (" -Download Size:", details.get_download_size()) - #print (" -Installed Size:", details.get_installed_size()) - #print (" -License:", details.get_license()) - #print (" -Id:", details.get_id()) - #print (" -Installed Version:", details.get_installed_version()) - #print (" -Version:", details.get_version()) - #print (" -Repository:", details.get_repo()) - #print (" -Launchable:", details.get_launchable()) - #print (" -Url:", details.get_url()) - #print (" -Instaled Date:", details.get_install_date()) - #print (" -Dependences:", details.get_depends()) - #print (" -packager:", details.get_packager()) - #print (" -reason:", details.get_reason()) - #print (" -groups:", details.get_groups()) - #print (" -optdepends:", details.get_optdepends()) - #print (" -checkdepends:", details.get_checkdepends()) - #print (" -makedepends:", details.get_makedepends()) - #print (" -conflicts:", details.get_conflicts()) - #print (" -provides:", details.get_provides()) - #print (" -replaces:", details.get_replaces()) - #print (" -build_date:", details.get_build_date()) - #print (" -has_signature:", details.get_has_signature()) - #print (" -requiredby:", details.get_requiredby()) - #print (" -optionalfor:", details.get_optionalfor()) - #print (" -backups:", details.get_backups()) - - print ('
') - update_version = subprocess.run(["pacman", "-Qu", sys.argv[1], '|', "awk","'{print $NF}'"], stdout=subprocess.PIPE, text=True) - print ('
') - print ('
') +TMP_FOLDER = os.environ["TMP_FOLDER"] +LIBRARY = '/usr/share/bigbashview/bcc/shell' +script_name = LIBRARY + "/bstrlib.sh" + + +def print_pkg_details(details): + loc = "%d/%m/%Y" if locale.getlocale()[0] == "pt_BR" else "%Y/%m/%d" + # print (" -Name:", details.get_name()) + # print (" -Desc:", details.get_desc()) + # print (" -Long Desc:", details.get_long_desc()) + # print (" -Icon:", details.get_icon()) + # print (" -Screenshots:", details.get_screenshots()) + # print (" -Download Size:", details.get_download_size()) + # print (" -Installed Size:", details.get_installed_size()) + # print (" -License:", details.get_license()) + # print (" -Id:", details.get_id()) + # print (" -Installed Version:", details.get_installed_version()) + # print (" -Version:", details.get_version()) + # print (" -Repository:", details.get_repo()) + # print (" -Launchable:", details.get_launchable()) + # print (" -Url:", details.get_url()) + # print (" -Instaled Date:", details.get_install_date()) + # print (" -Dependences:", details.get_depends()) + # print (" -packager:", details.get_packager()) + # print (" -reason:", details.get_reason()) + # print (" -groups:", details.get_groups()) + # print (" -optdepends:", details.get_optdepends()) + # print (" -checkdepends:", details.get_checkdepends()) + # print (" -makedepends:", details.get_makedepends()) + # print (" -conflicts:", details.get_conflicts()) + # print (" -provides:", details.get_provides()) + # print (" -replaces:", details.get_replaces()) + # print (" -build_date:", details.get_build_date()) + # print (" -has_signature:", details.get_has_signature()) + # print (" -requiredby:", details.get_requiredby()) + # print (" -optionalfor:", details.get_optionalfor()) + # print (" -backups:", details.get_backups()) + + print("
") +# update_version = subprocess.run( +# ["pacman", "-Qu", sys.argv[1], "|", "awk", "'{print $NF}'"], +# stdout=subprocess.PIPE, +# text=True, +# ) + function_name = "sh_this_package_update" + package_name = sys.argv[1] + command = f'source {script_name} && {function_name} "{package_name}"' + update_version = subprocess.run(command, shell=True, stdout=subprocess.PIPE, text=True) + + # # Executa o primeiro comando + # p1 = subprocess.Popen( + # ["pacman", "-Qu", sys.argv[1]], stdout=subprocess.PIPE, text=True + # ) + # output_p1 = p1.communicate()[0] + # # Usando a saída do primeiro comando como entrada para o segundo comando + # p2 = subprocess.Popen( + # ["awk", "'{print $NF}'"], + # stdin=subprocess.PIPE, + # stdout=subprocess.PIPE, + # text=True, + # ) + # output_p2 = p2.communicate(input=output_p1)[0] + # update_version = output_p2.strip() + # print(update_version) + + print("
") + print("
") if details.get_icon() is None: - find_icon = subprocess.run(["find", "icons/", "/var/lib/flatpak/appstream/flathub/x86_64/active/icons/64x64/", "/usr/share/app-info/icons/archlinux-arch-community/64x64/", "/usr/share/app-info/icons/archlinux-arch-extra/64x64/","-type", "f", "-iname", '*' + details.get_name().split("-")[0] + '*', "-print", "-quit"], stdout=subprocess.PIPE, text=True) - if find_icon.stdout == '': - print ('
' + details.get_name()[0:3] + '
') + find_icon = subprocess.run( + [ + "find", + "icons/", + "/var/lib/flatpak/appstream/flathub/x86_64/active/icons/64x64/", + "/usr/share/app-info/icons/archlinux-arch-community/64x64/", + "/usr/share/app-info/icons/archlinux-arch-extra/64x64/", + "-type", + "f", + "-iname", + "*" + details.get_name().split("-")[0] + "*", + "-print", + "-quit", + ], + stdout=subprocess.PIPE, + text=True, + ) + if find_icon.stdout == "": + print( + "
" + + details.get_name()[0:3] + + "
" + ) else: - print ('') + print('') else: - print ('') - print ('
', details.get_id(), '
') - -# if os.path.exists('description/' + details.get_name() + '/' + locale.getdefaultlocale()[0] + '/summary'): - if os.path.exists('description/' + details.get_name() + '/' + locale.getlocale()[0] + '/summary'): - print ('
') -# print(open('description/' + details.get_name() + '/' + locale.getdefaultlocale()[0] + '/summary', "r").read()) - print(open('description/' + details.get_name() + '/' + locale.getlocale()[0] + '/summary', "r").read()) - print ('
') + print('') + print("
", details.get_id(), "
") + + # if os.path.exists('description/' + details.get_name() + '/' + locale.getdefaultlocale()[0] + '/summary'): + if os.path.exists( + "description/" + details.get_name() + "/" + locale.getlocale()[0] + "/summary" + ): + print("
") + # print(open('description/' + details.get_name() + '/' + locale.getdefaultlocale()[0] + '/summary', "r").read()) + print( + open( + "description/" + + details.get_name() + + "/" + + locale.getlocale()[0] + + "/summary", + "r", + ).read() + ) + print("
") else: - print ('
', details.get_desc(), '
') - print ('
') + print("
", details.get_desc(), "
") + print('
') if details.get_installed_version(): - print ('') + print( + '", + ) if details.get_launchable(): - print ('') - - with open(TMP_FOLDER + '/upgradeable.txt') as f: - if '\n' + details.get_name() + '\n' in f.read(): - print ('') + print( + '", + ) + + with open(TMP_FOLDER + "/upgradeable.txt") as f: + if "\n" + details.get_name() + "\n" in f.read(): + print( + '", + ) else: if details.get_repo(): - print ('') + print( + '", + ) else: - print ('') - - screenshot_store = 'description/' + details.get_name() + '/screenshot' -# if details.get_long_desc() or details.get_screenshots() or os.path.exists(screenshot_store) or os.path.exists('description/' + details.get_name() + '/' + locale.getdefaultlocale()[0] + '/desc'): - if details.get_long_desc() or details.get_screenshots() or os.path.exists(screenshot_store) or os.path.exists('description/' + details.get_name() + '/' + locale.getlocale()[0] + '/desc'): + print( + '", + ) + + screenshot_store = "description/" + details.get_name() + "/screenshot" + # if details.get_long_desc() or details.get_screenshots() or os.path.exists(screenshot_store) or os.path.exists('description/' + details.get_name() + '/' + locale.getdefaultlocale()[0] + '/desc'): + if ( + details.get_long_desc() + or details.get_screenshots() + or os.path.exists(screenshot_store) + or os.path.exists( + "description/" + details.get_name() + "/" + locale.getlocale()[0] + "/desc" + ) + ): screenshot_resolution = open(TMP_FOLDER + "/screenshot-resolution.txt", "r") - print ('
') + print("
") if os.path.exists(screenshot_store): screenshot_list = open(screenshot_store, "r") - print ('
    ') + print('
      ') for screenshot in screenshot_list.readlines(): - print ('
    • ') - print ('') - print ('
    ') + print( + '
  • ', + ) + print( + '", + ) + print("
") else: if details.get_screenshots(): - print ('
    ') + print('
      ') for screenshot in details.get_screenshots(): - print ('
    • ') - print ('') - print ('
    ') - -# if os.path.exists('description/' + details.get_name() + '/' + locale.getdefaultlocale()[0] + '/desc'): - if os.path.exists('description/' + details.get_name() + '/' + locale.getlocale()[0] + '/desc'): - print ('
    ') -# print(open('description/' + details.get_name() + '/' + locale.getdefaultlocale()[0] + '/desc', "r").read()) - print(open('description/' + details.get_name() + '/' + locale.getlocale()[0] + '/desc', "r").read()) - print ('
') + print('
  • ') + print( + '", + ) + print("
    ") + + # if os.path.exists('description/' + details.get_name() + '/' + locale.getdefaultlocale()[0] + '/desc'): + if os.path.exists( + "description/" + details.get_name() + "/" + locale.getlocale()[0] + "/desc" + ): + print("
    ") + # print(open('description/' + details.get_name() + '/' + locale.getdefaultlocale()[0] + '/desc', "r").read()) + print( + open( + "description/" + + details.get_name() + + "/" + + locale.getlocale()[0] + + "/desc", + "r", + ).read() + ) + print("
    ") else: if details.get_long_desc(): - print ('
    ', details.get_long_desc(), '
    ') + print( + "
    ", + details.get_long_desc(), + "
    ", + ) if details.get_long_desc() or details.get_screenshots(): - print ('
    ') + print("") - print ('
    ') + print("
    ") - print ('
    ') - print ('
    ', _('Pacote:'), '
    ') - print ('
    ', sys.argv[1], '
    ') + print('
    ') + print("
    ", _("Pacote:"), "
    ") + print("
    ", sys.argv[1], "
    ") if details.get_installed_version(): - print ('
    ') - print ('
    ', _('Versão instalada:'), '
    ') - print ('
    ', details.get_installed_version(), '
    ') - print ('
    ') + print('
    ') + print("
    ", _("Versão instalada:"), "
    ") + print("
    ", details.get_installed_version(), "
    ") + print("
    ") else: - print ('
    ') - print ('
    ', _('Versão disponivel:'), '
    ') - print ('
    ', details.get_version(), '
    ') - if update_version.stdout != '': - print ('
    ') - print ('
    ', _('Versão disponivel:'), '
    ') - print ('
    ', update_version.stdout, '
    ') - - print ('
    ', _('Uso de armazenamento:'), '
    ', str(round(details.get_installed_size() / (1024 * 1024), 1)), 'MB
    ') + print('
    ') + print("
    ", _("Versão disponivel:"), "
    ") + print("
    ", details.get_version(), "
    ") + if update_version.stdout != "": + print('
    ') + print("
    ", _("Versão disponivel:"), "
    ") + print("
    ", update_version.stdout, "
    ") + + print( + "
    ", + _("Uso de armazenamento:"), + "
    ", + str(round(details.get_installed_size() / (1024 * 1024), 1)), + "MB
    ", + ) if details.get_download_size(): - print ('
    ', _('Tamanho do download:'), '
    ', str(round(details.get_download_size() / (1024 * 1024), 1)), 'MB
    ') + print( + "
    ", + _("Tamanho do download:"), + "
    ", + str(round(details.get_download_size() / (1024 * 1024), 1)), + "MB
    ", + ) if details.get_url(): - print ('
    ') - print ('
    ', _('Site:'), '
    ') - print ('
    ', details.get_url(), '
    ') + print('
    ') + print("
    ", _("Site:"), "
    ") + print( + '
    ', + details.get_url(), + "
    ", + ) if details.get_license(): - print ('
    ') - print ('
    ', _('Licença:'), '
    ') - print ('
    ', details.get_license(), '
    ') + print('
    ') + print("
    ", _("Licença:"), "
    ") + print('
    ', details.get_license(), "
    ") if details.get_repo(): - print ('
    ') - print ('
    ', _('Repositório:'), '
    ') - print ('
    ', details.get_repo(), '
    ') + print('
    ') + print("
    ", _("Repositório:"), "
    ") + print('
    ', details.get_repo(), "
    ") if details.get_packager(): - print ('
    ') - print ('
    ', _('Empacotador:'), '
    ') - print ('
    ', details.get_packager(), '
    ') + print('
    ') + print("
    ", _("Empacotador:"), "
    ") + print('
    ', details.get_packager(), "
    ") if details.get_build_date(): - print ('
    ') - print ('
    ', _('Data do empacotamento:'), '
    ') - print ('
    ') - print (datetime.datetime.fromtimestamp(int(details.get_build_date().to_unix()) - ).strftime(loc)) - print ('
    ') + print('
    ') + print("
    ", _("Data do empacotamento:"), "
    ") + print('
    ') + print( + datetime.datetime.fromtimestamp( + int(details.get_build_date().to_unix()) + ).strftime(loc) + ) + print("
    ") if details.get_install_date(): - print ('
    ') - print ('
    ', _('Data de instalação:'), '
    ') - print ('
    ') - print (datetime.datetime.fromtimestamp( - int(details.get_install_date().to_unix()) - ).strftime(loc)) - print ('
    ') + print('
    ') + print("
    ", _("Data de instalação:"), "
    ") + print('
    ') + print( + datetime.datetime.fromtimestamp( + int(details.get_install_date().to_unix()) + ).strftime(loc) + ) + print("
    ") if details.get_reason(): - print ('
    ') - print ('
    ', _('Motivo da instalação:'), '
    ') - print ('
    ', details.get_reason(), '
    ') + print('
    ') + print("
    ", _("Motivo da instalação:"), "
    ") + print('
    ', details.get_reason(), "
    ") if details.get_groups(): - print ('
    ') - print ('
    ', _('Grupos:'), '
    ') - print ('
    ') + print('
    ') + print("
    ", _("Grupos:"), "
    ") + print('
    ') for group in details.get_groups(): - print (group + '
    ') - print ('
    ') + print(group + "
    ") + print("
    ") - #if details.get_has_signature(): - #print ('
    ') - #print ('
    ', _('Assinado:'), '
    ') - #print ('
    ', details.get_has_signature(), '
    ') + # if details.get_has_signature(): + # print ('
    ') + # print ('
    ', _('Assinado:'), '
    ') + # print ('
    ', details.get_has_signature(), '
    ') if details.get_optdepends(): - print ('
    ') - print ('
    ', _('Complementos:'), '
    ') - print ('
    ') - print ('
    ') + print('
    ') + print("
    ", _("Complementos:"), "
    ") + print('
    ') + print('
    ') for optdepends in details.get_optdepends(): - optdepends_name=optdepends.split(':')[0]; - optdepends_desc=optdepends.split(':')[1]; - installed_dep = subprocess.run(["pacman", "-Qq", optdepends_name], stdout=subprocess.PIPE, text=True) - print ('
    ') - if installed_dep.stdout == '': - print ('
    ') - print ('
    ' + _('Instalar'), optdepends_name, '
    ' + optdepends_desc) + optdepends_name = optdepends.split(":")[0] + optdepends_desc = optdepends.split(":")[1] + installed_dep = subprocess.run( + ["pacman", "-Qq", optdepends_name], stdout=subprocess.PIPE, text=True + ) + print("
    ") + if installed_dep.stdout == "": + print( + '
    ' + ) + print( + "
    " + _("Instalar"), + optdepends_name, + "
    " + optdepends_desc, + ) else: - print ('
    ') - print ('
    ') + print( + '
    ") + print("
    ") if details.get_depends(): - print ('
    ') - print ('
    ', _('Dependências:'), '
    ') - print ('
    ') + print('
    ') + print("
    ", _("Dependências:"), "
    ") + print('
    ') for depends in details.get_depends(): - print (depends + '
    ') - print ('
    ') + print(depends + "
    ") + print("
    ") if details.get_conflicts(): - print ('
    ') - print ('
    ', _('Remove:'), '
    ') - print ('
    ') + print('
    ') + print("
    ", _("Remove:"), "
    ") + print('
    ') for conflicts in details.get_conflicts(): - print (conflicts + '
    ') - print ('
    ') + print(conflicts + "
    ") + print("
    ") if details.get_replaces(): - print ('
    ') - print ('
    ', _('Substitui:'), '
    ') - print ('
    ') + print('
    ') + print("
    ", _("Substitui:"), "
    ") + print('
    ') for replaces in details.get_replaces(): - print (replaces + '
    ') - print ('
    ') - - print ('
    ') - print ('
    ', _('Arquivos do pacote:'), '
    ') - print ('
    ') - - print ('', _('Clique aqui para ver os arquivos'), '') - print ('
    ') + print( + "$('#listPgkFiles').click(function(e){$.get('./load.sh','pkg_not_installed " + + sys.argv[1] + + "',function(data){$('#files_in_package').html(data);})})" + ) + # print( + # "$('#listPgkFiles').click(function(e){$.get('/usr/share/bigbashview/bcc/shell/bstrlib.sh sh_load', 'pkg_not_installed " + # + sys.argv[1] + # + "',function(data){$('#files_in_package').html(data);})})" + # ) + print("") + print("
    ") if __name__ == "__main__": @@ -277,18 +477,16 @@ def print_pkg_details (details): config.set_enable_flatpak(False) config.set_enable_snap(False) db = Pamac.Database(config=config) - pkgname = '^'+sys.argv[1]+'$' - + pkgname = "^" + sys.argv[1] + "$" # To multi packages - #db.enable_appstream() - #pkgs = db.search_pkgs (pkgname) - #for pkg in pkgs: - #print_pkg_details (pkg) - #break - + # db.enable_appstream() + # pkgs = db.search_pkgs (pkgname) + # for pkg in pkgs: + # print_pkg_details (pkg) + # break # To single package -# db.enable_appstream() + # db.enable_appstream() pkg = db.get_pkg(sys.argv[1]) - print_pkg_details (pkg) + print_pkg_details(pkg) diff --git a/big-store/usr/share/bigbashview/bcc/apps/big-store/view_aur.py b/big-store/usr/share/bigbashview/bcc/apps/big-store/view_aur.py index 4adc432f1..14ee83570 100755 --- a/big-store/usr/share/bigbashview/bcc/apps/big-store/view_aur.py +++ b/big-store/usr/share/bigbashview/bcc/apps/big-store/view_aur.py @@ -43,7 +43,12 @@ print ('
    ', p['Description'], '
    ') print ('
    ') pkg_installed = subprocess.run(["pacman", "-Q", sys.argv[1]], stdout=subprocess.PIPE, text=True) - pkg_installed_version = subprocess.run(["./pkg_pacman_version"], stdout=subprocess.PIPE, text=True) + + function_name = "sh_pkg_pacman_version" + package_name = sys.argv[1] + command = f'source {script_name} && {function_name} "{package_name}"' +# pkg_installed_version = subprocess.run(["./pkg_pacman_version"], stdout=subprocess.PIPE, text=True) + pkg_installed_version = subprocess.run(command, shell=True, stdout=subprocess.PIPE, text=True) if pkg_installed.stdout: print ('') if pkg_installed_version.stdout.strip() != p['Version'].strip(): @@ -130,7 +135,7 @@ function_name = "sh_pkg_pacman_build_date" package_name = sys.argv[1] command = f'source {script_name} && {function_name} "{package_name}"' -# pkg_build_date = subprocess.run(["./pkg_pacman_build_date", sys.argv[1]], stdout=subprocess.PIPE, text=True) +# pkg_build_date = subprocess.run(["./pkg_pacman_build_date", sys.argv[1]], stdout=subprocess.PIPE, text=True) pkg_build_date = subprocess.run(command, shell=True, stdout=subprocess.PIPE, text=True) if pkg_build_date.stdout != '': print ('
    ') @@ -140,7 +145,7 @@ function_name = "sh_pkg_pacman_install_date" package_name = sys.argv[1] command = f'source {script_name} && {function_name} "{package_name}"' -# pkg_install_date = subprocess.run(["./pkg_pacman_install_date", sys.argv[1]], stdout=subprocess.PIPE, text=True) +# pkg_install_date = subprocess.run(["./pkg_pacman_install_date", sys.argv[1]], stdout=subprocess.PIPE, text=True) pkg_install_date = subprocess.run(command, shell=True, stdout=subprocess.PIPE, text=True) if pkg_install_date.stdout != '': print ('
    ') diff --git a/big-store/usr/share/bigbashview/bcc/apps/big-store/view_flatpak.sh.htm b/big-store/usr/share/bigbashview/bcc/apps/big-store/view_flatpak.sh.htm index 34d860245..6df868cef 100755 --- a/big-store/usr/share/bigbashview/bcc/apps/big-store/view_flatpak.sh.htm +++ b/big-store/usr/share/bigbashview/bcc/apps/big-store/view_flatpak.sh.htm @@ -6,7 +6,7 @@ # Description: Big Store installing programs for BigLinux # # Created: 2022/11/01 -# Altered: 2023/08/18 +# Altered: 2023/08/24 # # Copyright (c) 2023-2023, Vilmar Catafesta # 2022-2023, Bruno Gonçalves @@ -34,7 +34,7 @@ # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. APP="${0##*/}" -_VERSION_="1.0.0-20230818" +_VERSION_="1.0.0-20230824" export BOOTLOG="/tmp/bigstore-$USER-$(date +"%d%m%Y").log" export LOGGER='/dev/tty8' export HOME_FOLDER="$HOME/.bigstore" @@ -61,14 +61,14 @@ ACTION="install_flatpak" REPOSITORY="$REPOSITORY" PACKAGE_ID="$PACKAGE_ID" - sh_run_action "$ACTION" + sh_run_action "$ACTION" "$WINDOW_ID" "$PACKAGE_NAME" "$PACKAGE_ID" "$REPOSITORY" "$DRIVER" fi if [[ "$pkg_remove" = "y" ]]; then ACTION="remove_flatpak" REPOSITORY="$REPOSITORY" PACKAGE_ID="$PACKAGE_ID" - sh_run_action "$ACTION" + sh_run_action "$ACTION" "$WINDOW_ID" "$PACKAGE_NAME" "$PACKAGE_ID" "$REPOSITORY" "$DRIVER fi cat <<-EOF diff --git a/big-store/usr/share/bigbashview/bcc/apps/big-store/view_snap.sh.htm b/big-store/usr/share/bigbashview/bcc/apps/big-store/view_snap.sh.htm index 304fe5521..f41f832e6 100755 --- a/big-store/usr/share/bigbashview/bcc/apps/big-store/view_snap.sh.htm +++ b/big-store/usr/share/bigbashview/bcc/apps/big-store/view_snap.sh.htm @@ -6,7 +6,7 @@ # Description: Control Center to help usage of BigLinux # # Created: 2022/02/28 -# Altered: 2023/08/18 +# Altered: 2023/08/24 # # Copyright (c) 2023-2023, Vilmar Catafesta # 2022-2023, Bruno Gonçalves @@ -34,7 +34,7 @@ # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. APP="${0##*/}" -_VERSION_="1.0.0-20230818" +_VERSION_="1.0.0-20230824" export BOOTLOG="/tmp/bigcontrolcenter-$USER-$(date +"%d%m%Y").log" export LOGGER='/dev/tty8' export HOME_FOLDER="$HOME/.bigstore" @@ -74,13 +74,13 @@ if [[ "$pkg_install" = "y" ]]; then ACTION="install_snap" PACKAGE_NAME="$(SNAP_INFO package_name)" - sh_run_action "$ACTION" + sh_run_action "$ACTION" "$WINDOW_ID" "$PACKAGE_NAME" "$PACKAGE_ID" "$REPOSITORY" "$DRIVER" fi if [[ "$pkg_remove" = "y" ]]; then ACTION="remove_snap" PACKAGE_NAME="$(SNAP_INFO package_name)" - sh_run_action "$ACTION" + sh_run_action "$ACTION" "$WINDOW_ID" "$PACKAGE_NAME" "$PACKAGE_ID" "$REPOSITORY" "$DRIVER" fi cat <<-EOF