-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Corrigido bug de não aparecer mensagem de log do erro;
Modularizado procedimento de listagem de arquivos executáveis e não-executáveis (bug da mensagem "DEB package created sucessfully" ainda não resolvido) (bug do "chmod: falta operando..." ainda não resolvido)
- Loading branch information
gustavosotnas
committed
Mar 26, 2015
1 parent
c0fee59
commit b04d5a5
Showing
5 changed files
with
119 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#! /bin/bash | ||
|
||
# Makefile to create quick-deb-builder .deb package | ||
# It's a lite version of quick-deb-builder | ||
# | ||
# Parameters: "$1" = username; "$2" = input folder; "$3" = output folder | ||
# | ||
# Author: Gustavo Moraes <gustavosotnas@gmail.com> | ||
# | ||
# This file is subject to the terms and conditions of the GNU General Public | ||
# License. See the file COPYING in the main directory of this archive | ||
# for more details. | ||
|
||
# function creater() | ||
# { | ||
cp -R "$2" /tmp/deb_packing; # Copia a pasta do pacote para a pasta temporária | ||
|
||
executable_files_tmp=$(find /tmp/deb_packing -type f -exec mimetype {} + | awk -F': +' '{ if ($2 ~ /^application\//) print $1 }') # Lista todos os arquivos executáveis (mimetype "aplication/...") da pasta | ||
non_executable_files_tmp=$(find /tmp/deb_packing -type f -exec mimetype {} + | awk -F': +' '{ if ($2 !~ /^application\//) print $1 }') # Lista todos os arquivos não-executáveis (mimetype != "aplication/...") da pasta | ||
# echo -e "TMP: \n\n$executable_files_tmp \n" | ||
|
||
old_IFS=$IFS; | ||
IFS=$'\n'; # define separador (quebra de linha) para array | ||
executable_files=($(echo "$executable_files_tmp")); # array / variável GLOBAL | ||
non_executable_files=($(echo "$non_executable_files_tmp")); | ||
IFS=$old_IFS; | ||
|
||
# echo -e "FINAL: \n\n ${executable_files[*]} \n" | ||
|
||
echo "${executable_files[*]}" | xargs chmod 0755; # Dá permissões rwxr-xr-x para todos os arquivos executáveis | ||
echo "${non_executable_files[*]}" | xargs chmod 0644 ; # Dá permissões rw-r--r-- para todos os arquivos não-executáveis # xargs: "saída padrão" de um comando são os "argumentos" do outro comando | ||
|
||
# As 4 próximas linhas não precisam de gerar log, são comandos de busca por arquivos não obrigatórios no pacote: | ||
2>/dev/null chmod 0644 /tmp/deb_packing/DEBIAN/md5sums || 2>/dev/null chmod 0644 /tmp/deb_packing/debian/md5sums; # Dá permissões rw-r--r-- para o arquivo "md5sums" na pasta "DEBIAN" | ||
2>/dev/null find /tmp/deb_packing/etc/sudoers.d/ -type f -exec chmod 0440 {} \; # Dá permissões r--r----- para todos os arquivos que estiverem na pasta /etc/sudoers.d, caso existam | ||
2>/dev/null /tmp/deb_packing/usr/share/doc/ /tmp/deb_packing/usr/share/man/ -type f -exec chmod -x {} \; # Retira permissões de execução (x) para todos os arquivos relacionados à documentação do software | ||
2>/dev/null find /tmp/deb_packing -type f -name "*.desktop" -exec chmod -x {} \; # Retira permissões de execução (x) para todos os arquivos ".desktop" (lançadores de aplicativos) | ||
|
||
|
||
#chown -R root: /tmp/deb_packing; # sudo Não vai pedir senha por causa do "sudoers.d" | ||
DPKG_DEB_OUTPUT=$(dpkg-deb -b /tmp/deb_packing "$3"); # sudo | ||
echo ${DPKG_DEB_OUTPUT//\'/\"} | cut -d'"' -f4 | sed 's/ \+/\\ /g' | xargs chown "$1":; | ||
|
||
rm -R /tmp/deb_packing; | ||
|
||
# } | ||
|
||
# creater "$1" "$2" "$3"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#! /bin/bash | ||
|
||
# Reinstall-deb: Automatizate the uninstallation, DEB package creation and | ||
# instalation of Quick DEB Builder in his latest version. | ||
# It puts the .deb file in "Área de Trabalho" folder. | ||
# | ||
# Author: Gustavo Moraes <gustavosotnas@gmail.com> | ||
# | ||
# This file is subject to the terms and conditions of the GNU General Public | ||
# License. See the file COPYING in the main directory of this archive | ||
# for more details. | ||
|
||
sudo apt-get purge -y quick-deb-builder | ||
echo -e "\033[1;34m\n\nO comando 'apt-get' retornou $?\n\n\033[0m"; | ||
sudo ./Makefile-deb "$USER" ../quick-deb-builder/ /home/"$USER"/Área\ de\ Trabalho/ | ||
echo -e "\033[1;34m\n\nO comando 'Makefile-deb' retornou $?\n\n\033[0m"; | ||
sudo dpkg -i /home/"$USER"/Área\ de\ Trabalho/quick-deb-builder*.deb | ||
echo -e "\033[1;34m\n\nO comando 'dpkg' retornou $?\n\n\033[0m"; |