def install(pkg, target='LocalSystem', store=False, allow_untrusted=False):
    '''
    Install a pkg file

    Args:
        pkg (str): The package to install
        target (str): The target in which to install the package to
        store (bool): Should the package be installed as if it was from the
                      store?
        allow_untrusted (bool): Allow the installation of untrusted packages?

    Returns:
        dict: A dictionary containing the results of the installation

    CLI Example:

    .. code-block:: bash

        salt '*' macpackage.install test.pkg
    '''
    if '*.' not in pkg:
        # If we use wildcards, we cannot use quotes
        pkg = _quote(pkg)

    target = _quote(target)

    cmd = 'installer -pkg {0} -target {1}'.format(pkg, target)
    if store:
        cmd += ' -store'
    if allow_untrusted:
        cmd += ' -allowUntrusted'

    # We can only use wildcards in python_shell which is
    # sent by the macpackage state
    python_shell = False
    if '*.' in cmd:
        python_shell = True

    return __salt__['cmd.run_all'](cmd, python_shell=python_shell)
def install ( pkg , target = 'LocalSystem' , store = False , allow_untrusted = False ) : if '*.' not in pkg : pkg = _quote ( pkg ) target = _quote ( target ) cmd = 'installer -pkg {0} -target {1}' . format ( pkg , target ) if store : cmd += ' -store' if allow_untrusted : cmd += ' -allowUntrusted' python_shell = False if '*.' in cmd : python_shell = True return __salt__ [ 'cmd.run_all' ] ( cmd , python_shell = python_shell )
Install a pkg file

    Args:
        pkg (str): The package to install
        target (str): The target in which to install the package to
        store (bool): Should the package be installed as if it was from the
                      store?
        allow_untrusted (bool): Allow the installation of untrusted packages?

    Returns:
        dict: A dictionary containing the results of the installation

    CLI Example:

    .. code-block:: bash

        salt '*' macpackage.install test.pkg