Beispiel #1
0
def command():
    """
    Require the git command-line tool.

    Example::

        from fabric.api import run
        from fabtools import require

        require.git.command()
        run('git --help')

    """
    from fabtools.require.deb import package as require_deb_package
    from fabtools.require.pkg import package as require_pkg_package
    from fabtools.require.rpm import package as require_rpm_package
    from fabtools.require.portage import package as require_portage_package
    from fabtools.system import distrib_family

    res = run('git --version', quiet=True)
    if res.failed:
        family = distrib_family()
        if family == 'debian':
            require_deb_package('git-core')
        elif family == 'redhat':
            require_rpm_package('git')
        elif family == 'sun':
            require_pkg_package('scmgit-base')
        elif family == 'gentoo':
            require_portage_package('dev-vcs/git')
        else:
            raise NotImplementedError()
Beispiel #2
0
def command():
    """
    Require the git command-line tool.

    Example::

        from fabric.api import run
        from fabtools import require

        require.git.command()
        run('git --help')

    """
    from fabtools.require.deb import package as require_deb_package
    from fabtools.require.pkg import package as require_pkg_package
    from fabtools.require.rpm import package as require_rpm_package
    from fabtools.require.portage import package as require_portage_package
    from fabtools.system import distrib_family

    res = run('git --version', quiet=True)
    if res.failed:
        family = distrib_family()
        if family == 'debian':
            require_deb_package('git-core')
        elif family == 'redhat':
            require_rpm_package('git')
        elif family == 'sun':
            require_pkg_package('scmgit-base')
        elif family == 'gentoo':
            require_portage_package('dev-vcs/git')
        else:
            raise NotImplementedError()