Questo Tool Permette di andare a vedere i ChangeLog che vi interessano direttamente senza
andare nelle varie directory del portage. Non e' una gran cosa ma penso sia utile.
Code: Select all
#!/bin/bash
# Gentoo (Portage/Overlays) ChangeLog Viewer. 0.9.1
# Salvate questo script come 'changelog' in una direcory del tipo '/usr/bin'
# o comunque una directory eseguibile.
# Entrate nella directory dove avete salvato questo file
# e date il comando 'chmod 755 changelog'
PROGRAM_NAME="viewcl"
PROGRAM_VERSION="0.9.1"
COLOR_DEFAULT='\033[0m'
COLOR_WHITE='\33[01;37m'
COLOR_LRED='\033[1;31m'
COLOR_LGREEN='\033[1;32m'
COLOR_LYELLOW='\033[1;33m'
SYMBOL_OK="${COLOR_LGREEN} *${COLOR_DEFAULT}"
SYMBOL_ER="${COLOR_LRED} *${COLOR_DEFAULT}"
SYMBOL_WR="${COLOR_LYELLOW} *${COLOR_DEFAULT}"
# Find $PORTDIR in /etc/make.conf or in /etc/make.globals...
# Default $PORTDIR = "/usr/portage"
if [ -f "/etc/make.conf" ]; then
source /etc/make.conf
if [ -f ${PORTDIR} ]; then
if [ -f "/etc/make.globals" ]; then
source /etc/make.globals
if [ -f ${PORTDIR} ]; then
PORTDIR="/usr/portage"
fi
fi
fi
if [ -f ${PORTDIR_OVERLAY} ]; then
if [ -f "/etc/make.globals" ]; then
source /etc/make.globals
if [ -f ${PORTDIR_OVERLAY} ]; then
PORTDIR_OVERLAY="/usr/local/overlays"
fi
fi
fi
else
if [ -f "/etc/make.globals" ]; then
source /etc/make.globals
if [ -f ${PORTDIR} ]; then
PORTDIR="/usr/portage"
fi
if [ -f ${PORTDIR_OVERLAY} ]; then
PORTDIR_OVERLAY="/usr/local/overlays"
fi
fi
fi
# Print Help, Usage and Info...
chlogviewer_usage() {
echo "ChangeLog Viewer ${PROGRAM_VERSION}"
echo
echo -e "${COLOR_WHITE} Usage:${COLOR_DEFAULT}"
echo " ${PROGRAM_NAME} [ app name ] [ ... ]"
echo " ${PROGRAM_NAME} --dir='<dir>' [ app name ] [ ... ]"
echo
echo -e "${SYMBOL_WR} Use Options '--dir=<dir>' for change ChangeLog find dir."
echo
echo
echo -e "${COLOR_WHITE} Examples:${COLOR_DEFAULT}"
echo " ${PROGRAM_NAME} x11-wm/fluxbox"
echo " ${PROGRAM_NAME} fluxbox xorg-x11 mm-sources"
echo " ${PROGRAM_NAME} morph-sources nitro-sources"
echo " ${PROGRAM_NAME} --dir='/home/myChangeLog' myprog"
echo
echo -e "${SYMBOL_WR} Portage Dir: '${PORTDIR}'"
echo -e "${SYMBOL_WR} Portage Overlays Dir: '${PORTDIR_OVERLAY}'"
echo
echo
echo "Report Bugs to <matteo_bertozzi@bsdmail.com>"
echo
}
# 'Search' and 'print' ChangeLog.
get_ChangeLog() {
chk_dir=$(echo ${1} | grep '/')
if [ "${chk_dir}" = '' ]; then
PATH_CHANGELOG="*/${1}"
else
PATH_CHANGELOG="${1}"
fi
if [ -s ${PORTDIR}/${PATH_CHANGELOG}/ChangeLog ]; then
echo -e "${SYMBOL_OK} '${1}' Changelog"
cat ${PORTDIR}/${PATH_CHANGELOG}/ChangeLog | less
else
if [ -s ${PORTDIR_OVERLAY}/${PATH_CHANGELOG}/ChangeLog ]; then
echo -e "${SYMBOL_OK} '${1}' Changelog in Overlays."
cat ${PORTDIR_OVERLAY}/${PATH_CHANGELOG}/ChangeLog | less
else
echo -e "${SYMBOL_ER} '${1}' ChangeLog Not Found..."
sleep ${2}
fi
fi
}
# M A I N
if [ $# -gt 0 ]; then
time=1
if [ $# -eq 1 ]; then
time=0
fi
for argv in $@; do
case "${argv}" in
--dir=*) PORTDIR=$(echo ${argv} | cut -d '=' -f 2-)
if [ $# -eq 2 ]; then
time=0
fi
break;;
--help) chlogviewer_usage
exit 0;;
esac
done
# Loop for print ChangeLog.
for app in $@; do
if [ "$(echo ${app} | cut -d '=' -f 1-1)" != "--dir" ]; then
get_ChangeLog ${app} ${time}
fi
done
else
chlogviewer_usage
fi
Code: Select all
ChangeLog Viewer 0.9.1
Usage:
viewcl [ app name ] [ ... ]
viewcl --dir='<dir>' [ app name ] [ ... ]
* Use Options '--dir=<dir>' for change ChangeLog find dir.
Examples:
viewcl x11-wm/fluxbox
viewcl fluxbox xorg-x11 mm-sources
viewcl morph-sources nitro-sources
viewcl --dir='/home/myChangeLog' myprog
* Portage Dir: '/usr/portage'
* Portage Overlays Dir: '/usr/local/overlays'
Report Bugs to <matteo_bertozzi@bsdmail.com>
la sintassi e' changelog nomePacchetto.
Sarebbe meglio specificare la cartella in cui si trova il pacchetto:
Code: Select all
Es.
viewcl dev-lang/python
viewcl sys-kernel/gentoo-dev-sources
Code: Select all
Es.
viewcl python
viewcl gentoo-dev-sources
L'Installazione
Per l'installazione avete due possibilita' o scaricate l'ebuild del Gekit (http://forums.gentoo.org/viewtopic.php?p=1390953) oppure date i seguenti comandi:
Code: Select all
cd /usr/bin
wget http://gensid.altervista.org/devel/dev-sh/viewcl/viewcl.sh
mv viewcl.sh viewcl
chmod 755 viewcl
Se Avete qualche idea per migliorare il tool... Postate !!!

