def nopackage(pkg_name): """ Require a arch package to be uninstalled. Example:: from fabtools import require require.arch.nopackage('apache2') """ if is_installed(pkg_name): uninstall(pkg_name)
def package(pkg_name, update=False): """ Require a archlinux package to be installed. Example:: from fabtools import require require.arch.package('foo') """ if not is_installed(pkg_name): install(pkg_name, update)
def nopackages(pkg_list): """ Require several arch packages to be uninstalled. Example:: from fabtools import require require.arch.nopackages([ 'perl', 'php5', 'ruby', ]) """ pkg_list = [pkg for pkg in pkg_list if is_installed(pkg)] if pkg_list: uninstall(pkg_list)
def packages(pkg_list, update=False): """ Require several arch packages to be installed. Example:: from fabtools import require require.arch.packages([ 'foo', 'bar', 'baz', ]) """ pkg_list = [pkg for pkg in pkg_list if not is_installed(pkg)] if pkg_list: install(pkg_list, update)