Skip site navigation (1)Skip section navigation (2)
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

--wRRV7LY7NUeQGEoC
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

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? =20

The script is an almost automated way to upgrade all your ports to the
latest version.=20

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=3D`date +%d`
month=3D`date +%b`
year=3D`date +%Y`
host=3D`uname -n`

### Variouse ports that need stuff... Where should I put those?
# X11
X_WINDOW_SYSTEM=3Dxorg
# mutt
WITH_MUTT_MBOX_HOOK_PATCH=3Dyes
MAIL_GID=3Dmail
# rxvt
WITH_MOUSEWHEEL=3Dyes
WITH_RXVT_SCROLLBAR=3Dyes
WITH_MENUBAR=3Dyes
# imp3
WITH_APACHE2=3Dyes
WITHOUT_LDAP=3Dyes
# Aspell
ASPELL_EN=3Dyes

### 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=20
echo ''
### EOF
###########################################################################=
#####


--=20
yann@kierun.org                  -=3D*=3D-                      www.kierun.=
org
    PGP:   009D 7287 C4A7 FD4F 1680  06E4 F751 7006 9DE2 6318

--wRRV7LY7NUeQGEoC
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (FreeBSD)

iD8DBQFBkJ5G91FwBp3iYxgRArT/AJ41xHtzU6gDiSlIYi/Irew9run8BwCfXB10
fmlfeiIJVfP6Ai9Dahs5lTg=
=Fm+d
-----END PGP SIGNATURE-----

--wRRV7LY7NUeQGEoC--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20041109103902.GA69223>