#!/bin/bash #Translation export TEXTDOMAINDIR="/usr/share/locale" export TEXTDOMAIN=biglinux-deb-installer # Don't group windows xprop -id "$(xprop -root '\t$0' _NET_ACTIVE_WINDOW | cut -f 2)" -f WM_CLASS 8s -set WM_CLASS "$$" # Import BigControlCenter base modules / Importa os módulos básicos do BigControlCenter # That's include jquery and materialize / Isso inclui o jquery e o materialize # http://materializecss.com/ . /usr/share/bigbashview/bcc/shell/base.sh echo ' ' echo '' $"Instalar arquivos .deb" '' echo '' OIFS=$IFS IFS=$'\n' LC_ALL=C apt -s install $(cat /tmp/biglinux-deb-installer-list) > /tmp/packages_info_big.txt LC_ALL=C apt --print-uris install $(cat /tmp/biglinux-deb-installer-list) > /tmp/packages_info_big_uri.txt IFS=$OIFS # Verify is broken if [ "$(grep "\-\-fix-broken install" /tmp/packages_info_big.txt)" != "" ]; then echo '
' $"Aguarde um momento..." '
' echo '' exit 0 fi INSTALL_BUTTON="0" MSG_DEPENDS_BROKEN=$"Pacotes com dependências não atendidas: " MSG_DEPENDS=$"Depende de " MSG_DEPENDS_NOT_INSTALL=$"mas não vai ser instalado." MSG_NOT_INSTALLABLE=$"mas não está disponível" # Show local packages to install LOCAL_PACKAGES_TO_INSTALL="$(grep " local-deb \[" /tmp/packages_info_big.txt | grep "^Inst" | cut -f2,3 -d" " | sed 's| (| - |g;s|$|
|g')" # Show packages to install ADDITIONAL_PACKAGES_TO_INSTALL=$(sed -n '/following additional packages will be installed:/,/^\S/p' /tmp/packages_info_big.txt | grep "^ "| sed ':a;N;$!ba;s/\n/ /g;s| | |g;s| | |g;s|-|\‑|g') VERIFY_INSTALLED="$(grep "is already the newest version" /tmp/packages_info_big.txt)" # Show packages to remove PACKAGES_TO_REMOVE=$(sed -n '/following packages will be REMOVED:/,/^\S/p' /tmp/packages_info_big.txt | grep "^ "| sed ':a;N;$!ba;s/\n/ /g;s| | |g;s| | |g;s|-|\‑|g') # Show packages to upgrade PACKAGES_TO_UPGRADE=$(sed -n '/following packages will be upgraded:/,/^\S/p' /tmp/packages_info_big.txt | grep "^ "| sed ':a;N;$!ba;s/\n/ /g;s| | |g;s| | |g;s|-|\‑|g') IMPOSSIBLE="$(grep "requested an impossible situation" /tmp/packages_info_big.txt)" VALID_DEB="$(grep "Reading state information" /tmp/packages_info_big.txt)" # Show download size needed DOWNLOAD_SIZE="$(grep "Need to get" /tmp/packages_info_big_uri.txt | sed 's|Need to get ||g;s| of.*||g;s|/.*||g')" NUMBER_UPGRADED_PACKAGES="$(grep -i "newly installed" /tmp/packages_info_big_uri.txt | cut -f1 -d" ")" NUMBER_NEW_PACKAGES="$(grep -i "newly installed" /tmp/packages_info_big_uri.txt | cut -f3 -d" ")" NUMBER_REMOVE_PACKAGES="$(grep -i "newly installed" /tmp/packages_info_big_uri.txt | cut -f6 -d" ")" echo '
' echo '
' echo '
' echo $"Instalar arquivos .deb" echo '
' if [ "$IMPOSSIBLE" != "" ]; then echo $"Não é possível prosseguir com a instalação.

" grep -A 200 "following information may help to resolve the situation" /tmp/packages_info_big.txt | grep -v "following information may help to resolve the situation" | sed "s|The following packages have unmet dependencies:|$MSG_DEPENDS_BROKEN
|g;s|Depends|$MSG_DEPENDS|g;s|but it is not going to be installed|$MSG_DEPENDS_NOT_INSTALL
|g;s|but it is not installable|$MSG_NOT_INSTALLABLE
|" exit 0 fi if [ "$VALID_DEB" = "" ]; then echo $"Selecione um pacote .deb válido.

" exit 0 fi if [ "$VERIFY_INSTALLED" != "" ]; then echo $"Um ou mais pacotes já estavam instalados:" "
$(echo "$VERIFY_INSTALLED" | grep "is already the newest version" | sed 's| .*(| - |g;s|).|
|g')" echo "
" REINSTALL_BUTTON="1" fi if [ "$LOCAL_PACKAGES_TO_INSTALL" != "" ]; then echo $"Pacotes selecionados para instalar:" "
$LOCAL_PACKAGES_TO_INSTALL
" echo "
" INSTALL_BUTTON="1" fi if [ "$DOWNLOAD_SIZE" != "0 B" ] && [ "$DOWNLOAD_SIZE" != "" ]; then echo "
" $"É preciso fazer o download de" "
$DOWNLOAD_SIZE
" echo "

" fi if [ "$NUMBER_NEW_PACKAGES" != "0" ]; then echo "
" $"Total de pacotes para instalar:" "
$NUMBER_NEW_PACKAGES
" echo "

" INSTALL_BUTTON="1" fi if [ "$NUMBER_REMOVE_PACKAGES" != "0" ]; then echo "
" $"Total de pacotes a remover:" "
$NUMBER_REMOVE_PACKAGES
" echo "

" fi if [ "$NUMBER_UPGRADED_PACKAGES" != "0" ]; then echo "
" $"Pacotes a atualizar:" "
$NUMBER_UPGRADED_PACKAGES
" echo "

" INSTALL_BUTTON="1" fi if [ "$ADDITIONAL_PACKAGES_TO_INSTALL" != "" ]; then echo $"Dependencias a serem instaladas:" "
$ADDITIONAL_PACKAGES_TO_INSTALL
" echo "
" INSTALL_BUTTON="1" fi if [ "$PACKAGES_TO_REMOVE" != "" ]; then echo $"Pacotes a remover:" "
$PACKAGES_TO_REMOVE
" echo "
" fi if [ "$PACKAGES_TO_UPGRADE" != "" ]; then echo $"Pacotes para atualizar:" "
$PACKAGES_TO_UPGRADE
" echo "
" INSTALL_BUTTON="1" fi echo '
' echo '
' echo '' $"Cancelar" '' if [ "$INSTALL_BUTTON" = "1" ]; then echo '' $"Instalar" '' else if [ "$REINSTALL_BUTTON" = "1" ]; then echo '' $"Reinstalar" '' fi fi echo '
' echo "
" echo '' echo ''