

def install(packages, update=False, options=None):
    "\n    Install one or more Portage packages.\n\n    If *update* is ``True``, the package definitions will be updated\n    first, using :py:func:`~fabtools.portage.update_index`.\n\n    Extra *options* may be passed to ``emerge`` if necessary.\n\n    Example::\n\n        import fabtools\n\n        # Update index, then install a single package\n        fabtools.portage.install('mongodb', update=True)\n\n        # Install multiple packages\n        fabtools.arch.install([\n            'dev-db/mongodb',\n            'pymongo',\n        ])\n\n    "
    manager = MANAGER
    if update:
        update_index()
    options = (options or [])
    options = ' '.join(options)
    if (not isinstance(packages, basestring)):
        packages = ' '.join(packages)
    cmd = ('%(manager)s %(options)s %(packages)s' % locals())
    run_as_root(cmd, pty=False)

dataset/ETHPy150Open ronnix/fabtools/fabtools/portage.py install/original