svn commit: r411283 - head/Tools/scripts

John Marino marino at FreeBSD.org
Thu Mar 17 13:18:23 UTC 2016


Author: marino
Date: Thu Mar 17 13:18:21 2016
New Revision: 411283
URL: https://svnweb.freebsd.org/changeset/ports/411283

Log:
  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.

Modified:
  head/Tools/scripts/redundant-opt-files.sh

Modified: head/Tools/scripts/redundant-opt-files.sh
==============================================================================
--- head/Tools/scripts/redundant-opt-files.sh	Thu Mar 17 13:07:50 2016	(r411282)
+++ head/Tools/scripts/redundant-opt-files.sh	Thu Mar 17 13:18:21 2016	(r411283)
@@ -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


More information about the svn-ports-all mailing list