So writing a fabfile function, I attempt to automate the setup of a particular mac os x machine like this.
from fabric.api import local, env, sudo, require
def mac_port_setup():
PACKAGES = ['vim +python27', 'htop']
for item in PACKAGES:
local('sudo port -v install {0}'.format(item))
The PACKAGES
list can actually be a huge list and I want to avoid installing a package if the package is already installed. What are the possible ways to go about preventing an already installed package from being re-installed in my fabric automation?