FindPage
View Source:
KnowledgeBase/FreeBSD/UpdatePorts
*Note:* I just use [ports-mgmt/portmaster|http://www.freshports.org/ports-mgmt/portmaster/] now ---- Sync ports tree <code brush=bash> csup ports-supfile </code> Update INDEXes <code brush=bash> portsdb -Uu pkgdb -u </code> Get a list of out-of-date ports <code brush=bash> pkg_version -vl '<' | cut -d' ' -f1 </code> Pull dependency information for each out-of-date port (Children must be rebuilt/reinstalled as well) <code brush=bash> pkg_info -Rq </code> Do this recursively, keeping track of the depth. Once you hit bottom on all the ports and their descendants, squash the depgraph, placing deeper dependencies later. I.e.: <code> A -B -C --D E -B -D =becomes= A E B C D == </code> <code brush="bash"> bdeptree() { port="${1##/usr/ports/}" printf "%${2}s%s\n" "" "${port}" ( cd /usr/ports/${port} ( make build-depends-list [ "${2:-0}" -gt 0 ] && make run-depends-list ) | sort -u | while read port do bdeptree "${port}" $(( ${2:-0} + 1 )) done ) } rdeptree() { port="${1##/usr/ports/}" printf "%${2}s%s\n" "" "${port}" ( cd /usr/ports/${port} make run-depends-list | sort -u | while read port do rdeptree "${port}" $(( ${2:-0} + 1 )) done ) } </code> BASH script is at [CheckPorts.sh|KnowledgeBase/FreeBSD/CheckPorts.sh] Once you have a list of ports to install, and their order, you can use a convenience function in sh to build a package <code brush=bash> makepkg() { rm *.tbz make all deinstall install package clean && mv -v *.tbz /build/pkg/ } </code>