aboutsummaryrefslogtreecommitdiff
path: root/Tools
diff options
context:
space:
mode:
authorJohn Marino <marino@FreeBSD.org>2016-03-17 13:18:21 +0000
committerJohn Marino <marino@FreeBSD.org>2016-03-17 13:18:21 +0000
commitaafd1917505e5f2cbe383c6cedeb627fdeb0e0d2 (patch)
tree31af76fe362b6fe4725e46bed7bd4be6308ef298 /Tools
parent2e28ad59773655042b796650711c33f26dc2c922 (diff)
downloadports-aafd1917505e5f2cbe383c6cedeb627fdeb0e0d2.tar.gz
ports-aafd1917505e5f2cbe383c6cedeb627fdeb0e0d2.zip
redundant-opt-files.sh script: validate PORTSDIR value
Before checking validity of $db_dir, verify $portdir is valid and eject if it is not. This provides a better error message when PORTSDIR is invalid.
Notes
Notes: svn path=/head/; revision=411283
Diffstat (limited to 'Tools')
-rwxr-xr-xTools/scripts/redundant-opt-files.sh6
1 files changed, 6 insertions, 0 deletions
diff --git a/Tools/scripts/redundant-opt-files.sh b/Tools/scripts/redundant-opt-files.sh
index a86efb7e477c..6d028f153e1a 100755
--- a/Tools/scripts/redundant-opt-files.sh
+++ b/Tools/scripts/redundant-opt-files.sh
@@ -9,6 +9,12 @@
# deleted in order to prevent future configuration check failures.
portsdir=${PORTSDIR:-/usr/ports}
+if [ ! -d "${portsdir}" ]; then
+ echo "The ${portsdir} ports directory does not exist"
+ echo "There is nothing more to do."
+ exit
+fi
+
db_dir=$(/usr/bin/make -C ${portsdir}/devel/gmake -V PORT_DBDIR 2>/dev/null)
if [ ! -d "${db_dir}" ]; then