aboutsummaryrefslogtreecommitdiffstats
path: root/Tools
diff options
context:
space:
mode:
authoreik <eik@FreeBSD.org>2004-03-29 03:13:34 +0800
committereik <eik@FreeBSD.org>2004-03-29 03:13:34 +0800
commit891bcb9aecfc6ec17987565c7a50f2442c5b989f (patch)
treee3842c3543c7e73da658a0642333784c7e326553 /Tools
parentc8d0dc709f51fd16cdc4787686f60c8823b9cd9a (diff)
downloadfreebsd-ports-gnome-891bcb9aecfc6ec17987565c7a50f2442c5b989f.tar.gz
freebsd-ports-gnome-891bcb9aecfc6ec17987565c7a50f2442c5b989f.tar.zst
freebsd-ports-gnome-891bcb9aecfc6ec17987565c7a50f2442c5b989f.zip
added an -q option to enable usage in crontab.
Suggested by: erwin
Diffstat (limited to 'Tools')
-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 f563407e65e7..c770f1f75e8f 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}