diff options
author | eik <eik@FreeBSD.org> | 2004-03-28 19:13:34 +0000 |
---|---|---|
committer | eik <eik@FreeBSD.org> | 2004-03-28 19:13:34 +0000 |
commit | 891bcb9aecfc6ec17987565c7a50f2442c5b989f (patch) | |
tree | e3842c3543c7e73da658a0642333784c7e326553 /Tools/scripts | |
parent | c8d0dc709f51fd16cdc4787686f60c8823b9cd9a (diff) | |
download | FreeBSD-ports-891bcb9aecfc6ec17987565c7a50f2442c5b989f.zip FreeBSD-ports-891bcb9aecfc6ec17987565c7a50f2442c5b989f.tar.gz |
added an -q option to enable usage in crontab.
Suggested by: erwin
Diffstat (limited to 'Tools/scripts')
-rwxr-xr-x | Tools/scripts/chkorigin.sh | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/Tools/scripts/chkorigin.sh b/Tools/scripts/chkorigin.sh index f563407..c770f1f 100755 --- a/Tools/scripts/chkorigin.sh +++ b/Tools/scripts/chkorigin.sh @@ -46,7 +46,26 @@ # [env PORTSDIR=/usr/ports] chkorigin.sh [category ...] # -echo "checking categories for ports with a wrong PKGORIGIN" +opt_verbose=false +opt_quiet=false + +while getopts vq opt; do + case "$opt" in + q) + opt_quiet=true;; + v) + opt_verbose=true;; + ?) + echo "Usage: $0 [-qv] [category ...]" + exit 2;; + esac +done + +shift $((${OPTIND}-1)) + +rc=0 + +$opt_quiet || echo "checking categories for ports with a wrong PKGORIGIN" cd "${PORTSDIR:=/usr/ports}" if [ $# -gt 0 ]; then @@ -66,7 +85,7 @@ for category in ${CATEGORIES}; do packages) continue ;; esac - echo "==> ${category}" + $opt_quiet || echo "==> ${category}" cd "${PORTSDIR}/${category}" PORTS=`echo *` @@ -77,11 +96,17 @@ for category in ${CATEGORIES}; do CVS) continue ;; pkg) continue ;; esac + + $opt_verbose && echo "==> ${category}/${port}" + cd "${PORTSDIR}/${category}/${port}" PKGORIGIN=`/usr/bin/make -VPKGORIGIN 2>/dev/null || true"` if [ "${PKGORIGIN}" != "${category}/${port}" ]; then echo "port \"${category}/${port}\" has the wrong PKGORIGIN \"${PKGORIGIN}\"" + rc=1 fi done done + +return ${rc} |