summaryrefslogtreecommitdiffstats
path: root/Tools/scripts
diff options
context:
space:
mode:
authoreik <eik@FreeBSD.org>2004-03-28 19:13:34 +0000
committereik <eik@FreeBSD.org>2004-03-28 19:13:34 +0000
commit891bcb9aecfc6ec17987565c7a50f2442c5b989f (patch)
treee3842c3543c7e73da658a0642333784c7e326553 /Tools/scripts
parentc8d0dc709f51fd16cdc4787686f60c8823b9cd9a (diff)
downloadFreeBSD-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-xTools/scripts/chkorigin.sh29
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}
OpenPOWER on IntegriCloud