Source code for fabtools.require.pkg

"""
SmartOS packages
================

This module provides high-level tools for managing SmartOS packages.

"""
from __future__ import with_statement

from fabtools.pkg import (
    install,
    is_installed,
    uninstall,
)


[docs]def package(pkg_name, update=False, yes=None): """ Require a SmartOS package to be installed. :: from fabtools import require require.pkg.package('foo') """ if not is_installed(pkg_name): install(pkg_name, update, yes)
[docs]def packages(pkg_list, update=False): """ Require several SmartOS packages to be installed. :: from fabtools import require require.pkg.packages([ 'top', 'unzip', 'zip', ]) """ pkg_list = [pkg for pkg in pkg_list if not is_installed(pkg)] if pkg_list: install(pkg_list, update)
[docs]def nopackage(pkg_name, orphan=True): """ Require a SmartOS package to be uninstalled. :: from fabtools import require require.pkg.nopackage('top') """ if is_installed(pkg_name): uninstall(pkg_name, orphan)
[docs]def nopackages(pkg_list, orphan=True): """ Require several SmartOS packages to be uninstalled. :: from fabtools import require require.pkg.nopackages([ 'top', 'zip', 'unzip', ]) """ pkg_list = [pkg for pkg in pkg_list if is_installed(pkg)] if pkg_list: uninstall(pkg_list, orphan)
Read the Docs v: 0.17.0
Versions
latest
0.17.0
0.16.0
0.15.0
0.14.0
0.13.0
0.12.0
0.11.0
Downloads
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.