Differences between version 6 and predecessor to the previous major change of KnowledgeBase/FreeBSD/UpdatePorts.
Other diffs: Previous Revision, Previous Author
Newer page: |
version 6 |
Last edited on Wednesday, 9 April 2008 7:24:45 |
by CyberLeo |
Revert |
Older page: |
version 5 |
Last edited on Wednesday, 9 April 2008 6:15:02 |
by CyberLeo |
Revert |
@@ -37,65 +37,12 @@
==
</verbatim>
BASH script is at [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
-#!/usr/bin/env bash
-str_repeat
() {
- repeat="${1}"
- while [ "${repeat}"
-gt 0 ]
- do
- echo -n "${2}"
- repeat=$(( ${repeat} - 1))
- done
+makepkg
() {
+ make all deinstall install package clean
+ mv
-v *.tbz ~/packages/
-clear_deps() {
- depth=0
- storevar="list_${depth}"
- eval list=\${${storevar}}
- while [ -n "${list}" ]
- do
- echo "Clearing $storevar"
- unset $storevar
- depth=$(( ${depth} + 1 ))
- storevar="list_${depth}"
- eval list=\${${storevar}}
- done
-}
-resolve_deps(){
- depth="${1}"
- storevar="list_${depth}"
- shift
- while [ -n "${1}" ]
- do
- str_repeat ${depth} -
- echo "${1}"
- eval ${storevar}="\"\${${storevar}} ${1}\""
- deps=$(pkg_info -Rq "${1}" | sed -e '/^$/d')
- if [ -n "${deps}" ]
- then
- resolve_deps $(( ${depth} + 1 )) ${deps}
- depth=$(( ${depth} - 1 ))
- storevar="list_${depth}"
- fi
- shift
- done
-}
-print_deps() {
- depth=0
- storevar="$(printf "list_%u" "${depth}")"
- eval list=\${${storevar}}
- while [ -n "${list}" ]
- do
- for item in ${list}
- do
- printf "%u\t%s\n" "${depth}" "${item}"
- done
- depth=$(( ${depth} + 1 ))
- storevar="list_${depth}"
- eval list=\${${storevar}}
- done
-}
-clear_deps
-resolve_deps 0 $(pkg_version -vl '<' | cut -d' ' -f1)
-print_deps | sort --key=2 --reverse | uniq -f 1 | sort | cut -f2 | while read name; do pkgdb -qo "${name}"; done
version 6
Sync ports tree
csup ports-supfile
Update INDEXes
portsdb -Uu
pkgdb -u
Get a list of out-of-date ports
pkg_version -vl '<' | cut -d' ' -f1
Pull dependency information for each out-of-date port (Children must be rebuilt/reinstalled as well)
pkg_info -Rq
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.:
A
-B
-C
--D
E
-B
-D
=becomes=
A
E
B
C
D
==
BASH script is at 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
makepkg() {
make all deinstall install package clean
mv -v *.tbz ~/packages/
}