svn commit: r411809 - head/Tools/scripts

John Marino marino at FreeBSD.org
Thu Mar 24 20:17:01 UTC 2016


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)


More information about the svn-ports-head mailing list