From owner-svn-ports-all@freebsd.org Thu Mar 24 20:17:01 2016 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 184D8ADCE76; Thu, 24 Mar 2016 20:17:01 +0000 (UTC) (envelope-from marino@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D99C21C23; Thu, 24 Mar 2016 20:17:00 +0000 (UTC) (envelope-from marino@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2OKH00e036900; Thu, 24 Mar 2016 20:17:00 GMT (envelope-from marino@FreeBSD.org) Received: (from marino@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2OKH0SV036895; Thu, 24 Mar 2016 20:17:00 GMT (envelope-from marino@FreeBSD.org) Message-Id: <201603242017.u2OKH0SV036895@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marino set sender to marino@FreeBSD.org using -f From: John Marino Date: Thu, 24 Mar 2016 20:17:00 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r411809 - head/Tools/scripts X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2016 20:17:01 -0000 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)