Date: Tue, 9 Nov 2004 10:39:02 +0000 From: Yann Golanski <yann@kierun.org> To: freebsd-stable@freebsd.org Subject: Portupgrade script. Message-ID: <20041109103902.GA69223@kierun.org>
next in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
Would people be kind enough to have a look at the following script and
tell me what horrors/faux pas/stupid things I have done?
The script is an almost automated way to upgrade all your ports to the
latest version.
Of course, I bet someone else has done this and I'll be told to RTFM.
My excuse is that I didn't find it on my own... ;>
################################################################################
#!/bin/sh
# portupgrade script.
### variables.
day=`date +%d`
month=`date +%b`
year=`date +%Y`
host=`uname -n`
### Variouse ports that need stuff... Where should I put those?
# X11
X_WINDOW_SYSTEM=xorg
# mutt
WITH_MUTT_MBOX_HOOK_PATCH=yes
MAIL_GID=mail
# rxvt
WITH_MOUSEWHEEL=yes
WITH_RXVT_SCROLLBAR=yes
WITH_MENUBAR=yes
# imp3
WITH_APACHE2=yes
WITHOUT_LDAP=yes
# Aspell
ASPELL_EN=yes
### Does what it does...
/usr/local/bin/cvsup -g -L 2 /usr/ports/CVSUP
less /usr/ports/UPDATING
echo '[UPDATING] Do you want to update the port tree? [yn]?'
read -p '[y]es or [n]o: ' -e val
case ${val} in
[yY])
echo 'Updating the port collection now!!!...'
;;
[nN])
echo 'Aborting NOW!!!...'
exit;
;;
*)
echo 'What the hell?... I am aborting now.'
exit;
;;
esac
/usr/local/sbin/portaudit -Fda
/usr/local/sbin/portsdb -Uu
/usr/local/sbin/pkgdb -F
/usr/bin/tar ycf /var/db/$year-$month-$day-pkg.tbz2 /var/db/pkg
/usr/local/sbin/portupgrade -C -u -v -r -R -P -a -l /usr/ports/LATEST.update
cat /usr/ports/LATEST.update | \
sort | \
mail -s "Portupdate $host on $day $month $year" root@$host
/usr/local/sbin/portsclean -C -L -P
### reporting.
echo ''
echo 'This is what has been updated today:'
/usr/bin/grep -v '^\-' /usr/ports/LATEST.update | sort
echo ''
### EOF
################################################################################
--
yann@kierun.org -=*=- www.kierun.org
PGP: 009D 7287 C4A7 FD4F 1680 06E4 F751 7006 9DE2 6318
[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (FreeBSD)
iD8DBQFBkJ5G91FwBp3iYxgRArT/AJ41xHtzU6gDiSlIYi/Irew9run8BwCfXB10
fmlfeiIJVfP6Ai9Dahs5lTg=
=Fm+d
-----END PGP SIGNATURE-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20041109103902.GA69223>
