diff options
author | marino <marino@FreeBSD.org> | 2016-03-25 04:16:59 +0800 |
---|---|---|
committer | marino <marino@FreeBSD.org> | 2016-03-25 04:16:59 +0800 |
commit | a4f961276bf83bceb69b502871e056a8d9a8870a (patch) | |
tree | 23482de14a3aa442ab1ab8fa7c4a39383baddc96 /Tools | |
parent | d5795e0347d050d50826849c2bf6d241d581b6ab (diff) | |
download | freebsd-ports-gnome-a4f961276bf83bceb69b502871e056a8d9a8870a.tar.gz freebsd-ports-gnome-a4f961276bf83bceb69b502871e056a8d9a8870a.tar.zst freebsd-ports-gnome-a4f961276bf83bceb69b502871e056a8d9a8870a.zip |
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.
Diffstat (limited to 'Tools')
-rwxr-xr-x | Tools/scripts/redundant-opt-files.sh | 5 |
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) |