#!/bin/sh - # # This script collects a list of ports that require updating # (i.e. the version in /usr/ports is newer than the one that # is currently installed), and then adds all of the ports that # depend on them. Then the complete list is printed, ordered # by dependencies, so that you should be able to update your # ports in that order. # # Important: This script requiresd the "portorder" script, # written by the same author. # # Howto: # # 1. Update your ports collection: # a. Make a copy of /usr/share/examples/cvsup/ports-supfile # and edit it to include a CVSUP server near to your # location. See www.freebsd.org for a list of CVSUP # servers all over the world. # b. Type as root: # csup my-ports-supfile # c. Optionally, download a fresh ports index (as root): # cd /usr/ports; make fetchindex # # Alternatively, you can download the full ports collection # from ftp.freebsd.org (or many of the FTP mirrors all over # the world) from /pub/FreeBSD/ports/ports/ports.tar.gz # (it is built once per day). This is especially useful if # you don't have the ports collection installed at all, # because it is more efficient than running csup on an empty # directory. This is how to download and install it: # cd /tmp # fetch ftp://ftp.freebsd.org/pub/FreeBSD/ports/ports/ports.tar.gz # cd /usr # rm -rf ports # tar xzf /tmp/ports.tar.gz # Optionally, download a ports index (see above). # # 2. Run this script to make a list for updating your ports # (this doesn't require root privilege): # ports-update-list > ports-todo.txt # # 3. Use the "portup" script (written by the same author) to # perform the actual updates (as root): # awk '{print $1}' ports-todo.txt | xargs portup -y # (The awk command is required to cut the first column from # the file.) Please refer to the included documentation # of the "portup" script. # STATUSPKG=/etc/periodic/weekly/400.status-pkg PORTORDER=portorder $STATUSPKG 2>&1 \ | grep 'needs updating' \ | $PORTORDER \ | tail -r \ | while read PKG REST; do case "$REST" in "needs updating"*) echo "$PKG $REST" pkg_info -R $PKG | grep '^[^ ]*-' ;; esac done \ | sort -k1,1 -u \ | $PORTORDER #--