Install Essencials
Merge request reports
Activity
Filter activity
1 #!/bin/bash 2 3 if ! dpkg -l wine | grep -q ^ii; then 4 sudo apt-get install wine -y 5 fi 6 7 if ! dpkg -l gcc-mingw-w64 | grep -q ^ii; then 8 sudo apt-get install gcc-mingw-w64 -y 9 fi 10 11 if ! dpkg -l p7zip-full | grep -q ^ii; then 12 sudo apt-get install p7zip-full -y 13 fi 14 Aqui é melhor fazer algo assim:
REQUIRED_PKGS="wine gcc-mingw-w64 p7zip-full" pkgs_to_install="" for pkg in $REQUIRED_PKGS; do if ! dpkg --get-selections $pkg | grep -w install$; then pkgs_to_install="$pkgs_to_install $pkg" fi done
sudo apt-get install $pkgs_to_install
Dessa forma é bem mais rápido de executar e mais fácil de adicionar um novo pacote quando necessário.
25 if ! test -d ~/.wine/drive_c/Python27/Lib/site-packages/py2exe;then 26 wget "http://downloads.sourceforge.net/project/py2exe/py2exe/0.6.9/py2exe-0.6.9.win32-py2.7.exe?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fpy2exe%2Ffiles%2Fpy2exe%2F0.6.9%2F&ts=1377212687&use_mirror=ufpr" -O "/tmp/py2exe.exe" 27 wine "/tmp/py2exe.exe" 28 fi 29 30 if ! test -f ~/.wine/drive_c/Python27/Lib/site-packages/pywin32.version.txt;then 31 wget "http://downloads.sourceforge.net/project/pywin32/pywin32/Build%20218/pywin32-218.win32-py2.7.exe?r=http%3A%2F%2Fsourceforge.net%2Fsettings%2Fmirror_choices%3Fprojectname%3Dpywin32%26filename%3Dpywin32%2FBuild%2520218%2Fpywin32-218.win32-py2.7.exe&ts=1391792648&use_mirror=ufpr" -O "/tmp/pywin32.exe" 32 wine "/tmp/pywin32.exe" 33 fi 34 35 if ! test -f ~/.wine/drive_c/Python27/Lib/site-packages/wmi.pyc;then 36 wget "https://pypi.python.org/packages/any/W/WMI/WMI-1.4.9.win32.exe#md5=31ef47dc10ff13a81a0cb8e6a98a0819" -O "/tmp/wmi.exe" 37 wine "/tmp/wmi.exe" 38 fi 39 40 if ! test -f 7zS.sfx;then 4 sudo apt-get install wine -y 5 fi 6 7 if ! dpkg -l gcc-mingw-w64 | grep -q ^ii; then 8 sudo apt-get install gcc-mingw-w64 -y 9 fi 10 11 if ! dpkg -l p7zip-full | grep -q ^ii; then 12 sudo apt-get install p7zip-full -y 13 fi 14 15 if ! test -d ~/.wine/drive_c/Program\ Files/NSIS; then 16 wget "http://unsis.googlecode.com/files/nsis-2.45.1-Unicode-setup.exe" -O "/tmp/nsis-2.45.exe" 17 wine "/tmp/nsis-2.45.exe" 18 fi 19 Com todos esses test você consegue fazer um esquema parecido com o que falei. Nesse caso você vai precisar do caminho do programa na máquina e da url pra baixar, algo como "required_wine_pkgs=pkg_a_path:pkg_a_url,pkg_b_path:pkg_b_url". Assim você consegue iterar sobre essa string. Talvez fique mais bonito usando hash também, tem que ver.
Please register or sign in to reply