Exemplo n.º 1
0
def show(packages, requirements):
    """Display command used to install packages."""
    try:
        packages = list(packages)
        packages.extend(api.parse_requirements_file(requirements))
        echo(api.install_command(packages))
    except exceptions.UnixPackageException as error:
        echo(error)
        exit(1)
Exemplo n.º 2
0
def install(packages, polite, requirements):
    """Install package."""
    try:
        packages = list(packages)
        packages.extend(api.parse_requirements_file(requirements))
        api.install(packages, polite=polite)
    except exceptions.UnixPackageException as error:
        echo(error)
        exit(1)
Exemplo n.º 3
0
def check(packages, requirements):
    """Check to see if a package is installed."""
    try:
        packages = list(packages)
        packages.extend(api.parse_requirements_file(requirements))
        if api.packages_installed(packages):
            echo("Package(s) installed")
        else:
            for package in packages:
                if not api.packages_installed([package, ]):
                    echo("Package '{0}' is not installed. Install with 'unixpackage install {0}'".format(
                        package
                    ))
    except exceptions.UnixPackageException as error:
        echo(error)
        exit(1)