Skip to content

Instantly share code, notes, and snippets.

@graffic
Created June 23, 2018 09:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save graffic/ae1c74742a5287b0b2df0e5112060d11 to your computer and use it in GitHub Desktop.
Save graffic/ae1c74742a5287b0b2df0e5112060d11 to your computer and use it in GitHub Desktop.
Macports utils
#!/bin/bash
set -x
cd $MACPORTS/var/macports/sources/rsync.macports.org/release/tarballs/ports/
sed -i '' '/libGLU/d' ./lang/erlang/Portfile
portindex
#!env zsh
var_macports=~/macports/var/macports
directories=(software build distfiles packages)
cleanup () {
final_dir=$var_macports/$1
if [[ ! -d $final_dir ]]; then
echo "Nothing to do with $final_dir"
return
fi
echo "Cleanup $final_dir/*"
rm -rf $final_dir/*
}
echo "Uninstall inactive"
port uninstall inactive
for direct in $directories
do
cleanup $direct
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment