Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 17 Mar 2016 13:18:22 +0000 (UTC)
From:      John Marino <marino@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r411283 - head/Tools/scripts
Message-ID:  <201603171318.u2HDIMQV016256@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201603171318.u2HDIMQV016256>