Commit f1dfc15937f9152a87aa61339adb6fc760dea4b7
1 parent
baa596c6
Exists in
master
Adiciona scripts de execução e atualização do VLibras
Showing
5 changed files
with
115 additions
and
14 deletions
Show diff stats
| ... | ... | @@ -0,0 +1,22 @@ |
| 1 | +#! /bin/sh | |
| 2 | +set -e | |
| 3 | +notify-send -u critical -i "/opt/vlibras_desktop/vlibras_player_Data/Resources/UnityPlayer.png" VLibras "Aguarde enquanto as dependências do VLibras são instaladas... | |
| 4 | +Isso pode levar alguns minutos!" | |
| 5 | + | |
| 6 | +case $1 in | |
| 7 | + '') | |
| 8 | + eval "$(debconf-apt-progress --config)" | |
| 9 | + "$0" debconf | |
| 10 | + ;; | |
| 11 | + debconf) | |
| 12 | + . /usr/share/debconf/confmodule | |
| 13 | + debconf-apt-progress --start | |
| 14 | + debconf-apt-progress --from 0 --to 30 -- apt-get update | |
| 15 | + debconf-apt-progress --from 30 --to 50 -- apt-get install --force-yes --yes vlibras-aelius | |
| 16 | + debconf-apt-progress --from 50 --to 100 -- apt-get install --force-yes --yes dicionario-vlibras:i386 | |
| 17 | + debconf-apt-progress --stop | |
| 18 | + ;; | |
| 19 | +esac | |
| 20 | + | |
| 21 | +notify-send -u critical -i "/opt/vlibras_desktop/vlibras_player_Data/Resources/UnityPlayer.png" | |
| 22 | +VLibras-Desktop "As dependências foram instaladas e o VLibras está pronto para ser usado!" | ... | ... |
| ... | ... | @@ -0,0 +1,31 @@ |
| 1 | +#!/bin/bash | |
| 2 | + | |
| 3 | +function check_exported_variable () | |
| 4 | +{ | |
| 5 | + outline=$(printenv | grep $1) | |
| 6 | + if [[ "" == "$outline" ]] || [[ ! "$outline" =~ "vlibras" ]]; then | |
| 7 | + eval 'export '$1'='$2 | |
| 8 | + fi | |
| 9 | +} | |
| 10 | + | |
| 11 | +check_exported_variable "HUNPOS_TAGGER" "/opt/vlibras_aelius/bin/hunpos-tag" | |
| 12 | +check_exported_variable "AELIUS_DATA" "/opt/vlibras_aelius/aelius_data" | |
| 13 | +check_exported_variable "NLTK_DATA" "/opt/vlibras_aelius/nltk_data" | |
| 14 | +check_exported_variable "TRANSLATE_DATA" "/opt/vlibras_desktop/translate/data/" | |
| 15 | +check_exported_variable "PYTHONPATH" "/opt/vlibras_desktop/translate:/opt/vlibras_aelius:${PYTHONPATH}" | |
| 16 | + | |
| 17 | +PKG_DICT=$(dpkg-query -W --showformat='${Status}\n' dicionario-vlibras:i386 | grep "install ok installed") | |
| 18 | +PKG_AELIUS=$(dpkg-query -W --showformat='${Status}\n' vlibras-aelius | grep "install ok installed") | |
| 19 | + | |
| 20 | +if [ "" != "$PKG_DICT" ]; then | |
| 21 | + PKG_DICT_VERSION=$(apt-cache show patch1.0.0:i386 | grep "MD5sum" | awk '{ print $2 }') | |
| 22 | + if [ "$PKG_DICT_VERSION" == "2e60f8a56018f3c756ffa0c282766c2b" ]; then | |
| 23 | + gksudo -m "<b>Uma atualização necessária foi encontrada! Digite sua senha para instalar.</b>" "gnome-terminal --hide-menubar -x bash -c 'apt-get clean && apt-get update && apt-get install --reinstall --force-yes --yes patch1.0.0:i386;'" | |
| 24 | + fi | |
| 25 | +fi | |
| 26 | + | |
| 27 | +if [ "" == "$PKG_DICT" ] || [ "" == "$PKG_AELIUS" ]; then | |
| 28 | + gksudo -m "<b>Uma atualização necessária foi encontrada! Digite sua senha para instalar.</b>" "gnome-terminal --hide-menubar -x bash -c '/./opt/vlibras_desktop/script/depends_install.sh;'" | |
| 29 | +fi | |
| 30 | + | |
| 31 | +/./opt/vlibras_desktop/vlibras_player -single-instance > /dev/null 2>&1 | |
| 0 | 32 | \ No newline at end of file | ... | ... |
| ... | ... | @@ -0,0 +1,44 @@ |
| 1 | +#!/bin/bash | |
| 2 | +# | |
| 3 | +# | |
| 4 | +#-------------------- IMPORTANT ------------------------ | |
| 5 | +# -> To run this script you need to be a sudo user | | |
| 6 | +#------------------------------------------------------- | |
| 7 | + | |
| 8 | +set -e | |
| 9 | + | |
| 10 | +notify-send -u critical -i "/opt/vlibras_desktop/vlibras_player_Data/Resources/UnityPlayer.png" VLibras "As atualizações do dicionário estão sendo instaladas..." | |
| 11 | + | |
| 12 | +function check_update_patches() | |
| 13 | +{ | |
| 14 | + DIR="/opt/vlibras_desktop/vlibras_player_Data/Bundles" | |
| 15 | + count=0 | |
| 16 | + for d in "$DIR/*" ; do | |
| 17 | + count=$((count+1)) | |
| 18 | + apt-get install --only-upgrade --force-yes --yes patch${count}.0.0 > /dev/null 2>&1 | |
| 19 | + done | |
| 20 | +} | |
| 21 | + | |
| 22 | +case $1 in | |
| 23 | + '') | |
| 24 | + eval "$(debconf-apt-progress --config)" | |
| 25 | + "$0" debconf | |
| 26 | + ;; | |
| 27 | + debconf) | |
| 28 | + . /usr/share/debconf/confmodule | |
| 29 | + | |
| 30 | + PKG_DICT_VERSION=$(apt-cache show patch1.0.0:i386 | grep "MD5sum" | awk '{ print $2 }') | |
| 31 | + if [ "$PKG_DICT_VERSION" == "2e60f8a56018f3c756ffa0c282766c2b" ]; then | |
| 32 | + apt-get clean | |
| 33 | + apt-get update | |
| 34 | + apt-get install --reinstall --force-yes --yes patch1.0.0:i386 | |
| 35 | + fi | |
| 36 | + | |
| 37 | + # Start upgrade of the dictionary | |
| 38 | + debconf-apt-progress --start | |
| 39 | + debconf-apt-progress --from 0 --to 30 -- apt-get update | |
| 40 | + check_update_patches | |
| 41 | + debconf-apt-progress --from 30 --to 100 -- apt-get install --only-upgrade --force-yes --yes dicionario-vlibras:i386 | |
| 42 | + debconf-apt-progress --stop | |
| 43 | + ;; | |
| 44 | +esac | ... | ... |
script/update_vlibras.sh
| ... | ... | @@ -5,19 +5,23 @@ |
| 5 | 5 | # -> To run this script you need to be a sudo user | |
| 6 | 6 | #------------------------------------------------------- |
| 7 | 7 | |
| 8 | -# Update the list of repositories | |
| 9 | -apt-get update | |
| 8 | +set -e | |
| 10 | 9 | |
| 11 | -if [ $1 == "vlibras-desktop" ]; then | |
| 12 | - # Install the new version of vlibras-desktop | |
| 13 | - notify-send -u critical "O VLibras está sendo atualizado! Aguarde..." | |
| 14 | - #apt-get install --only-upgrade vlibras-desktop | |
| 15 | -else | |
| 16 | - if [ $1 == "dicionario-vlibras" ]; then | |
| 17 | - # Install the new version of dicionario-vlibras | |
| 18 | - notify-send -u critical "O Dicionário de sinais do VLibras está sendo atualizado..." | |
| 19 | - #apt-get install --only-upgrade dicionario-vlibras | |
| 20 | - fi | |
| 21 | -fi | |
| 10 | +notify-send -u critical -i "/opt/vlibras_desktop/vlibras_player_Data/Resources/UnityPlayer.png" VLibras "Aguarde! As atualizações do VLibras estão sendo instaladas... | |
| 11 | +Isso pode levar alguns minutos!" | |
| 22 | 12 | |
| 23 | -/./opt/vlibras_desktop/script/launcher.sh | |
| 24 | 13 | \ No newline at end of file |
| 14 | +case $1 in | |
| 15 | + '') | |
| 16 | + eval "$(debconf-apt-progress --config)" | |
| 17 | + "$0" debconf | |
| 18 | + ;; | |
| 19 | + debconf) | |
| 20 | + . /usr/share/debconf/confmodule | |
| 21 | + debconf-apt-progress --start | |
| 22 | + debconf-apt-progress --from 0 --to 25 -- apt-get update | |
| 23 | + debconf-apt-progress --from 25 --to 50 -- apt-get install --only-upgrade --force-yes --yes vlibras-desktop | |
| 24 | + debconf-apt-progress --from 50 --to 75 -- apt-get install --only-upgrade --force-yes --yes vlibras-aelius | |
| 25 | + debconf-apt-progress --from 75 --to 100 -- apt-get install --only-upgrade --force-yes --yes dicionario-vlibras:i386 | |
| 26 | + debconf-apt-progress --stop | |
| 27 | + ;; | |
| 28 | +esac | ... | ... |