SBoupgrade - Atualize seu SlackBuild!
Publicado por edps em 23/04/2015
[ Hits: 2.468 ]
Blog: https://edpsblog.wordpress.com/
#!/bin/bash
# Script written by Michales Michaloudes (korgie@gmail.com) for the SlackBuild community.
# Feel free to modify it, or to take the project to higher levels :)
#
# Use it at your own risk.
# Variables
SOURCES=${SOURCES:-../../sources} # the folder with the sources. I suggest to use relative path.
TEMPLATEFOLDER=${TEMPLATEFOLDER:-~/SlackBuilds} # the folder with template.README template.SlackBuild template.info template.slack-desc
if [ "$2" = "" ]; then
APPNAME=$(ls *.SlackBuild | gawk -F'.SlackBuild' ' { print $1 } ')
echo "You didn't provided program name, guessed: $APPNAME."
else
APPNAME=$2
fi
. $APPNAME.info
if [ "$1" = "" ]; then
NEWVERSION=$(ls -t1 $APPNAME*.tar* | head -1 | sed -e 's/.*-//' -e 's/.tar.*//g')
echo "You didn't provided version, guessed: $NEWVERSION."
else
NEWVERSION=$1
fi
echo -e "\nUpdating with $APPNAME-$NEWVERSION."
SOURCE=$(ls $APPNAME-$NEWVERSION.tar.* | sort | head -1)
# Append the md5sum to the info file
if [ -e $SOURCE ]; then
MD5SUMPRG=$(md5sum $SOURCE | cut -c 1-32)
else
echo "ERROR, source absent?"
exit 1
fi
#-----------------------------
#- SED bonanza -
#-----------------------------
# All files like slack-desc, Slackbuild, info will have the correct application name to be compiled
# find $TEMPLATEFOLDER/$NEWVERSION/$APPNAME -name $APPNAME.\* -exec sed -i "s/appname/$APPNAME/g" {} \;
# APPURL=$(cat ${SOURCES}/${APPNAME}.link)
sed -i "s/VERSION:-.*}/VERSION:-$NEWVERSION}/g" ./$APPNAME.SlackBuild
sed -i "s/VERSION=\".*\"/VERSION=\"$NEWVERSION\"/g" ./$APPNAME.info
sed -i "s/MD5SUM=\".*\"/MD5SUM=\"${MD5SUMPRG}\"/g" ./$APPNAME.info
sed -i "s,$VERSION,$NEWVERSION,g" ./$APPNAME.info
echo
echo "Check for yourself for errors."
grep $APPNAME $APPNAME.info
grep VERSION $APPNAME.SlackBuild
# vi $APPNAME.info
Adicionando Web Rádio em Blog (Blogger)
Adicionando temas no Ubuntu Lucid Lynx
Reduzindo o Tamanho de Imagens
GRUB 2 do Sabayon - Adicionando outras Distribuições GNU/Linux
Auto-login no GDM3 no Debian Squeeze ou outros
Removendo linhas duplicadas de um arquivo texto
Automoatizar backup no pfSense
Como verificar senha no shell script
Shell Script para colorir seus scripts
Sistema de backup em shell script
Nenhum comentário foi encontrado.
Monitorando o Preço do Bitcoin ou sua Cripto Favorita em Tempo Real com um Widget Flutuante
IA Turbina o Desktop Linux enquanto distros renovam forças
Como extrair chaves TOTP 2FA a partir de QRCODE (Google Authenticator)
Como realizar um ataque de força bruta para desobrir senhas?
Como usar Gpaste no ambiente Cinnamon
Atualizando o Fedora 42 para 43
Estou tentando ser legalista, mas tá complicado! (1)
PERFIL CRIADO NO SAMBA AD DC NÃO LOGA NO WINDOWS 10 E 11 (2)
É normal não gostar de KDE? (17)
PERFIL CRIADO NO SAMBA AD DC NÃO LOGA NO WINDOWS 10 E 11 (1)









