On 11 Jul 2017, at 23:35, Joshua Root <j...@macports.org> wrote:
> The attached script will find any Portfiles that are not referenced by any 
> installed port, and are thus safe to delete. It uses the same check that is 
> done during uninstall so I'm still not sure how they are getting left behind.

Thanks for the script. It removed almost all the unreferenced portfiles and I 
cleaned up some empty directories, but still left 15 for ports that are not 
installed (diff'ed /opt/local/var/macports/registry/portfiles/ and 
/opt/local/var/macports/software/).

MPREGPF=/opt/local/var/macports/registry/portfiles/

./find_unreferenced_portfiles.tcl | while read LINE ; do sudo rm -r 
$MPREGPF$LINE ; done

ls $MPREGPF | \
while read LINE ; \
do [[ $(ls $MPREGPF$LINE | wc -l | xargs) == 0 ]] \
&& sudo rm -r $MPREGPF$LINE ; done

Is it safe to delete the rest? I haven't manually checked the reg db yet.

Reply via email to