View previous topic :: View next topic |
Author |
Message |
_sys/sid Guru
Joined: 27 Aug 2004 Posts: 346 Location: Asola (Mantova)
|
Posted: Mon Nov 08, 2004 5:57 pm Post subject: [TOOL] viewcl 0.9.1 - ChangeLog Viewer |
|
|
viewcl 0.9.1 - ChangeLog Viewer http://gensid.altervista.org/devel/dev-sh/viewcl/viewcl.sh
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: |
#!/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: |
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>
|
Questo programma ha un funzionamente simile a emerge:
la sintassi e' changelog nomePacchetto.
Sarebbe meglio specificare la cartella in cui si trova il pacchetto:
Code: |
Es.
viewcl dev-lang/python
viewcl sys-kernel/gentoo-dev-sources
|
ma e' anche possibile dare solo il nome del pacchetto:
Code: |
Es.
viewcl python
viewcl gentoo-dev-sources
|
Il Risultato e' uguale...
L'Installazione
Per l'installazione avete due possibilita' o scaricate l'ebuild del Gekit (https://forums.gentoo.org/viewtopic.php?p=1390953) oppure date i seguenti comandi:
Code: |
cd /usr/bin
wget http://gensid.altervista.org/devel/dev-sh/viewcl/viewcl.sh
mv viewcl.sh viewcl
chmod 755 viewcl
|
Grazie per l'attenzione.
Se Avete qualche idea per migliorare il tool... Postate !!! _________________ http://th30z.netsons.org/
Last edited by _sys/sid on Tue Feb 22, 2005 6:21 pm; edited 8 times in total |
|
Back to top |
|
|
fedeliallalinea Administrator
Joined: 08 Mar 2003 Posts: 30991 Location: here
|
Posted: Mon Nov 08, 2004 5:59 pm Post subject: |
|
|
Ottimo cosi' resta piu' chiaro. Cambiato anche il link nei post utilissimi _________________ Questions are guaranteed in life; Answers aren't. |
|
Back to top |
|
|
_sys/sid Guru
Joined: 27 Aug 2004 Posts: 346 Location: Asola (Mantova)
|
Posted: Tue Feb 22, 2005 6:55 pm Post subject: |
|
|
- 22/02/05
Aggiunto il Supporto per la visualizzazione dei ChangeLog nella dir degli Overlays _________________ http://th30z.netsons.org/ |
|
Back to top |
|
|
|