summaryrefslogtreecommitdiff
path: root/Tools
diff options
context:
space:
mode:
authorJohn Marino <marino@FreeBSD.org>2016-03-24 20:16:59 +0000
committerJohn Marino <marino@FreeBSD.org>2016-03-24 20:16:59 +0000
commit4a68b19d0edc8c626a1c22add11d7a78b9262065 (patch)
tree23482de14a3aa442ab1ab8fa7c4a39383baddc96 /Tools
parent- Update to 13.0.20160304 (diff)
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.
Notes
Notes: svn path=/head/; revision=411809
Diffstat (limited to 'Tools')
-rwxr-xr-xTools/scripts/redundant-opt-files.sh5
1 files changed, 5 insertions, 0 deletions
diff --git a/Tools/scripts/redundant-opt-files.sh b/Tools/scripts/redundant-opt-files.sh
index 6d028f153e1a..505afc62db02 100755
--- a/Tools/scripts/redundant-opt-files.sh
+++ b/Tools/scripts/redundant-opt-files.sh
@@ -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)