Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 24 Mar 2016 20:17:00 +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: r411809 - head/Tools/scripts
Message-ID:  <201603242017.u2OKH0SV036895@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: marino
Date: Thu Mar 24 20:16:59 2016
New Revision: 411809
URL: https://svnweb.freebsd.org/changeset/ports/411809

Log:
  redundant-opt-files script: Handle cache for deleted ports
  
  The redundant-opt-file scripts assumes that if options are cached,
  then the port that it was created by still exists.  This, of course, is
  a terrible assumption.
  
  If the cached options refer to a port that has since been deleted or
  otherwise no longer exists, just print the origin and continue.  The
  normal use case is that the origin will be piped to xargs rm -rf which
  will purge the obsolete directory as desired.

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 24 18:55:25 2016	(r411808)
+++ head/Tools/scripts/redundant-opt-files.sh	Thu Mar 24 20:16:59 2016	(r411809)
@@ -38,6 +38,11 @@ catport() {
 
 identical_options() {
    local origin=$(catport $1)
+   if [ ! -d ${origin} ]; then
+       # origin no longer exists, list it anyway without testing further
+       echo ${origin}
+       return
+   fi
    local selected_pristine=$(/usr/bin/make -C ${origin} \
    	-V SELECTED_OPTIONS PORT_DBDIR=/dev/null)
    local selected_now=$(/usr/bin/make -C ${origin} -V SELECTED_OPTIONS)



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