diff options
Diffstat (limited to 'freebsd.sh/freebsd.ports.sh')
-rwxr-xr-x | freebsd.sh/freebsd.ports.sh | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/freebsd.sh/freebsd.ports.sh b/freebsd.sh/freebsd.ports.sh new file mode 100755 index 0000000..1fa4b5d --- /dev/null +++ b/freebsd.sh/freebsd.ports.sh @@ -0,0 +1,25 @@ +#!/bin/sh + +msg () { + echo "$@" 1>&2 +} + +[ -z "$1" ] && msg "Usage: $0 list_file" && exit 1 +: ${FREEBSD_VERSION:="`uname -r | sed 's|^\([0-9]*\).*$|\1|'`"} +: ${PORTSDIR:="/usr/ports"} +index="${PORTSDIR}/INDEX-${FREEBSD_VERSION}" + +shdir="$(dirname "$0")" +: ${shdir:="."} + +msg "==> FreeBSD version is ${FREEBSD_VERSION}" +msg "==> FreeBSD ports tree is ${PORTSDIR}" +msg "==> FreeBSD ports index file is ${index}" + +msg "==> Running freebsd.ports.find" +if "${shdir}/freebsd.ports.find" "$1" "${index}"; then + msg "==> Done!" +else + msg "==> Failed" + exit 1 +fi |