#!/usr/bin/env bash #shellcheck disable=SC2155,SC2034 #shellcheck source=/dev/null # /usr/share/bigbashview/bcc/apps/big-store/config.sh.htm # Description: Big Store installing programs for BigLinux # # Created: 2022/11/01 # Altered: 2024/05/08 # # Copyright (c) 2023-2023, Vilmar Catafesta # 2022-2023, Bruno Gonçalves # 2022-2023, Rafael Ruscher # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. APP="${0##*/}" _VERSION_="1.0.0-20240108" LIBRARY=${LIBRARY:-'/usr/share/bigbashview/bcc/shell'} export BOOTLOG="/tmp/bigstore-$USER-$(date +"%d%m%Y").log" export LOGGER='/dev/tty8' export TMP_FOLDER="/tmp/bigstore-$USER" export HOME_FOLDER="$HOME/.bigstore" export INI_FILE_BIG_STORE="$HOME_FOLDER/big-store.ini" [[ -f "${LIBRARY}/bcclib.sh" ]] && source "${LIBRARY}/bcclib.sh" [[ -f "${LIBRARY}/bstrlib.sh" ]] && source "${LIBRARY}/bstrlib.sh" [[ -f "${LIBRARY}/tinilib.sh" ]] && source "${LIBRARY}/tinilib.sh" function sh_config { #Translation export TEXTDOMAINDIR="/usr/share/locale" export TEXTDOMAIN=big-store declare -g Pacotes_text=$"Pacotes" declare -g Pacotes_flatpak_text=$"Pacotes Flatpak" declare -g Pacotes_Snap_text=$"Pacotes Snap" declare -g Traducao_Online_text=$"Tradução online da descrição dos pacotes" declare -g Ativado_text=$"Ativado" declare -g Desativado_text=$"Desativado" declare -g Atualizacoes_text=$"Atualizações" declare -g Atualizar_sistema_text=$"Atualizar seu sistema" declare -g Atualizar_text=$"Atualizar" declare -g Atualizado_text=$"Atualizado em" declare -g Atualizar_cache_text=$"Atualizar cache dos repositórios nativos" declare -g Atualizar_cache_pamac_text=$"Atualizar cache do Pamac" declare -g Procurar_servidor_mais_rapido_text=$"Procurar servidor de repositórios nativos mais rápidos" declare -g Utilize_as_opcoes_a_seguir_com_Cautela_text=$"Utilize as opções a seguir com cautela" declare -g Reinstalar_text=$"Reinstalação" declare -g Reinstalar_forcado_text=$"Forçar reinstalação de todos os pacotes instalados" declare -g Reinstalar_chaves=$"Atualizar as chaves dos repositórios BigLinux, Manjaro e Archlinux. Lembre que se você ativou repositórios complementares será necessário adicionar as chaves desses repositórios novamente." declare -g Executar_text=$"Executar" declare -g Forcar_atualizacao_text=$"Forçar atualizações, utilize essa opção se não estiver conseguindo atualizar o sistema, porém, na atualização forçada alguns programas podem ser removidos." declare -g Repositorios_nativos_text=$"Repositórios nativos" declare -g Configuracoes=$"Configurações" declare -g MsgSnap=$"Para os programas Snap aparecerem no menu do sistema finalize a sessão e faça login novamente." declare -g MsgFlatpak=$"Para os programas Flatpak aparecerem no menu do sistema finalize a sessão e faça login novamente." declare -g tmp_file_upgradeable="${TMP_FOLDER}/upgradeable.txt" } function sh_style { cat <<-EOF
EOF } function sh_vilmar { xdebug $0 } function sh_main { sh_style source header.sh.htm # param $1 pkg_name libpamac-flatpak-plugin # libpamac-snap-plugin if [[ -n "$pkg_install" ]] && [[ "$pkg_name" == "libpamac-snap-plugin" ]]; then if ! sh_package_is_installed "$pkg_name"; then sh_run_pamac_installer "$pkg_name" 'apparmor' 'snapd' fi # sh_run_action "enable_snapd" sh_run_action_standalone "sh_enable_snapd_and_apparmor" TIni.Set "$INI_FILE_BIG_STORE" "snap" "snap_active" '1' kdialog --title $"Big-Store" --msgbox "$MsgSnap\n\n$(systemctl status apparmor --lines=0)\n\n$(systemctl status snapd.apparmor --lines=0)\n\n$(systemctl status snapd --lines=0)" pacman -Qu | cut -f1 -d" " >>"$tmp_file_upgradeable" fi if [[ -n "$pkg_install" ]] && [[ "$pkg_name" == "libpamac-flatpak-plugin" ]]; then if ! sh_package_is_installed "$pkg_name"; then sh_run_pamac_installer "$pkg_name" 'flatpak' fi TIni.Set "$INI_FILE_BIG_STORE" "flatpak" "flatpak_active" '1' kdialog --title $"Big-Store" --msgbox "$MsgFlatpak\n\n$(flatpak --version)\n$(flatpak remotes)" pacman -Qu | cut -f1 -d" " >>"$tmp_file_upgradeable" fi if [[ -n "$pkg_remove" ]]; then if [[ "$pkg_name" = "libpamac-flatpak-plugin" ]]; then TIni.Set "$INI_FILE_BIG_STORE" "flatpak" "flatpak_active" '0' fi if [[ "$pkg_name" = "libpamac-snap-plugin" ]]; then TIni.Set "$INI_FILE_BIG_STORE" "snap" "snap_active" '0' fi # sh_run_pamac_remove $pkg_name pacman -Qu | cut -f1 -d" " >>"$tmp_file_upgradeable" fi [[ "$update_pacman" = "y" ]] && sh_run_action "update_pacman" "$WINDOW_ID" "$PACKAGE_NAME" "$PACKAGE_ID" "$REPOSITORY" "$DRIVER" [[ "$update_pamac" = "y" ]] && sh_run_action "update_pamac" "$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" [[ "$update_flatpak" = "y" ]] && sh_run_action "update_flatpak" "$WINDOW_ID" "$PACKAGE_NAME" "$PACKAGE_ID" "$REPOSITORY" "$DRIVER" [[ "$update_snap" = "y" ]] && sh_run_action "update_snap" "$WINDOW_ID" "$PACKAGE_NAME" "$PACKAGE_ID" "$REPOSITORY" "$DRIVER" [[ "$update_traducao" = "y" ]] && TIni.Set "$INI_FILE_BIG_STORE" "bigstore" "traducao_online" '1' [[ "$update_traducao" = "n" ]] && TIni.Set "$INI_FILE_BIG_STORE" "bigstore" "traducao_online" '0' cat <<-EOF
$Configuracoes
$Pacotes_text

EOF #FLATPAK cat <<-EOF
- $Pacotes_flatpak_text
  EOF if TIni.Exist "$INI_FILE_BIG_STORE" "flatpak" "flatpak_active" '1' && [[ -e "/usr/lib/libpamac-flatpak.so" ]]; then cat <<-EOF $Ativado_text
  EOF else cat <<-EOF $Desativado_text
  EOF fi #FLATPAK #SNAP cat <<-EOF
- $Pacotes_Snap_text
  EOF if TIni.Exist "$INI_FILE_BIG_STORE" "snap" "snap_active" '1' && [[ -e "/usr/lib/libpamac-snap.so" ]]; then cat <<-EOF $Ativado_text
  EOF else cat <<-EOF $Desativado_text
  EOF fi #SNAP #TRADUCAO BEGIN cat <<-EOF
- $Traducao_Online_text
  EOF if TIni.Exist "$INI_FILE_BIG_STORE" "bigstore" "traducao_online" '1'; then cat <<-EOF $Ativado_text
  EOF else cat <<-EOF $Desativado_text
  EOF fi #TRADUCAO END cat <<-EOF

EOF #NATIVOS BEGIN cat <<-EOF
$Repositorios_nativos_text

- $Atualizar_cache_text
  EOF if TIni.Exist "$INI_FILE_BIG_STORE" "nativo" "nativo_atualizado" '1'; then local nativo_data_atualizacao=$(TIni.Get "$INI_FILE_BIG_STORE" "nativo" "nativo_data_atualizacao") cat <<-EOF $Atualizado_text $nativo_data_atualizacao EOF else cat <<-EOF $Atualizar_text EOF fi cat <<-EOF
EOF # ter 09 jan 2024 00:25:25 -04 cat <<-EOF
- $Atualizar_cache_pamac_text
EOF # ter 09 jan 2024 00:25:25 -04 cat <<-EOF
- $Procurar_servidor_mais_rapido_text
EOF cat <<-EOF

EOF #NATIVOS END if TIni.Exist "$INI_FILE_BIG_STORE" "flatpak" "flatpak_active" '1' && [[ -e "/usr/lib/libpamac-flatpak.so" ]]; then cat <<-EOF
Repositório Flatpak

- Reconstruir base de dados Flatpak
  EOF if TIni.Exist "$INI_FILE_BIG_STORE" "flatpak" "flatpak_atualizado" '1'; then local flatpak_data_atualizacao=$(TIni.Get "$INI_FILE_BIG_STORE" "flatpak" "flatpak_data_atualizacao") cat <<-EOF $Atualizado_text $flatpak_data_atualizacao EOF else cat <<-EOF $Atualizar_text EOF fi cat <<-EOF

EOF fi if TIni.Exist "$INI_FILE_BIG_STORE" "snap" "snap_active" '1' && [[ -e "/usr/lib/libpamac-snap.so" ]]; then cat <<-EOF
Repositório Snap

- Reconstruir base de dados Snap
  EOF if TIni.Exist "$INI_FILE_BIG_STORE" "snap" "snap_atualizado" '1'; then local snap_data_atualizacao=$(TIni.Get "$INI_FILE_BIG_STORE" "snap" "snap_data_atualizacao") cat <<-EOF $Atualizado_text $snap_data_atualizacao EOF else cat <<-EOF $Atualizar_text EOF fi cat <<-EOF

EOF fi if TIni.Exist "$INI_FILE_BIG_STORE" "snap" "snap_active" '1' && [[ -e "/usr/lib/libpamac-snap.so" ]]; then cat <<-EOF
Repositório Snap

- Reconstruir base de dados Snap
  EOF if TIni.Exist "$INI_FILE_BIG_STORE" "snap" "snap_atualizado" '1'; then local snap_data_atualizacao=$(TIni.Get "$INI_FILE_BIG_STORE" "snap" "snap_data_atualizacao") cat <<-EOF $Atualizado_text $snap_data_atualizacao EOF else cat <<-EOF $Atualizar_text EOF fi cat <<-EOF

EOF fi cat <<-EOF
$Utilize_as_opcoes_a_seguir_com_Cautela_text

- $Reinstalar_forcado_text
  $Reinstalar_text
- $Reinstalar_chaves
- $Forcar_atualizacao_text

EOF } #sh_debug sh_config sh_main