HEX
Server: Apache
System: Linux server2.voipitup.com.au 4.18.0-553.109.1.lve.el8.x86_64 #1 SMP Thu Mar 5 20:23:46 UTC 2026 x86_64
User: posscale (1027)
PHP: 8.2.30
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //opt/saltstack/salt/lib/python3.10/site-packages/salt/states/__pycache__/cyg.cpython-310.pyc
o

�N�g"�@sNdZddlZe�e�Zdd�Zddd�Zddd	�Zdd
d�ZGdd
�d
�Z	dS)z�
Installation of Cygwin packages.

A state module to manage cygwin packages. Packages can be installed
or removed.

.. code-block:: yaml

    dos2unix:
      cyg.installed
�NcCsdtvrdSdS)z;
    Only load if cyg module is available in __salt__.
    �cyg.listT)Fzcyg module could not be loaded)�__salt__�rr�C/opt/saltstack/salt/lib/python3.10/site-packages/salt/states/cyg.py�__virtual__sr�x86_64cCs�|ddid�}|dvrd|d<d|d<|St�d	|�td
|||d�s.d|d<d|d<|Std
||�}||vrCd|d<d|d<|StdrQd|�d�|d<|Std|||d�rjd|d<d|d|<d|d<|Sd|d<d|d<|S)a7
    Make sure that a package is installed.

    name
        The name of the package to install

    cyg_arch : x86_64
        The cygwin architecture to install the package into.
        Current options are x86 and x86_64

    mirrors : None
        List of mirrors to check.
        None will use a default mirror (kernel.org)

    CLI Example:

    .. code-block:: yaml

        rsync:
          cyg.installed:
            - mirrors:
              - http://mirror/without/public/key: ""
              - http://mirror/with/public/key: http://url/of/public/key
    N���name�result�comment�changes��x86rFr�8The 'cyg_arch' argument must be one of 'x86' or 'x86_64'rz(Installed State: Initial Mirror list: %s�cyg.check_valid_package��cyg_arch�mirrors�Invalid package name.rTzPackage is already installed.�test�The package z would have been installedzcyg.installZ	Installedr
z"Package was successfully installedzCould not install package.)�log�debugr�__opts__)r
rr�retZpkgsrrr�	installeds8��rcCs�|ddid�}|dvrd|d<d|d<|Std	|||d
�s(d|d<d|d<|S|td||�vr;d
|d<d|d<|StdrId|�d�|d<|Std||�r`d
|d<d|d|<d|d<|Sd|d<d|d<|S)a:
    Make sure that a package is not installed.

    name
        The name of the package to uninstall

    cyg_arch : x86_64
        The cygwin architecture to remove the package from.
        Current options are x86 and x86_64

    mirrors : None
        List of mirrors to check.
        None will use a default mirror (kernel.org)

    CLI Example:

    .. code-block:: yaml

        rsync:
          cyg.removed:
            - mirrors:
              - http://mirror/without/public/key: ""
              - http://mirror/with/public/key: http://url/of/public/key
    Nrr	rFrrrrrrrTzPackage is not installed.rrz would have been removedz
cyg.uninstallZRemovedr
z!Package was successfully removed.zCould not remove package.)rr)r
rrrrrr�removedYs4��rcCs�dddid�}|dvrd|d<d|d	<|Std
rd|d	<|S|s&t�d�td
|d�}td||d�rstd
|d�}t||�}d|d<|��rOd|d	<|St|���|dd<t|���|dd<t|�	��|dd<d|d	<|Sd|d<d|d	<|S)a>
    Make sure all packages are up to date.

    name : None
        No affect, salt fails poorly without the arg available

    cyg_arch : x86_64
        The cygwin architecture to update.
        Current options are x86 and x86_64

    mirrors : None
        List of mirrors to check.
        None will use a default mirror (kernel.org)

    CLI Example:

    .. code-block:: yaml

        rsync:
          cyg.updated:
            - mirrors:
              - http://mirror/without/public/key: ""
              - http://mirror/with/public/key: http://url/of/public/key
    zcyg.updatedNrr	rFrrrrz$All packages would have been updatedz#No mirror given, using the default.r)rz
cyg.update)rTzNothing to update.r
�addedr�changedz"All packages successfully updated.zCould not update packages.)
rr�warningr�
DictDiffer�same�listrrr)r
rrr�beforeZafterZdifferrrr�updated�s4

	��r%c@s@eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dS)r!z�
    Calculate the difference between two dictionaries.

    (1) items added
    (2) items removed
    (3) keys same in both but changed values
    (4) keys same in both and unchanged values
    cCs<|||_|_dd�||fD�\|_|_|j�|j�|_dS)z'
        Iitialize the differ.
        css�|]	}t|���VqdS)N)�set�keys)�.0�drrr�	<genexpr>�s�
�z&DictDiffer.__init__.<locals>.<genexpr>N)�current_dict�	past_dict�current_keys�	past_keys�intersection�	intersect)�selfr+r,rrr�__init__�s
�zDictDiffer.__init__cCs|j|jkS)z5
        True if the two dicts are the same.
        )r+r,�r1rrrr"��zDictDiffer.samecC�|j|jS)z9
        Return a set of additions to past_dict.
        )r-r0r3rrrr�r4zDictDiffer.addedcCr5)z@
        Return a set of things removed from past_dict.
        )r.r0r3rrrr�r4zDictDiffer.removedc��fdd��jD�S)z?
        Return a set of the keys with changed values.
        cs$h|]}�j|�j|kr|�qSr�r,r+�r(�or3rr�	<setcomp>��$z%DictDiffer.changed.<locals>.<setcomp>�r0r3rr3rr��zDictDiffer.changedcr6)zA
        Return a set of the keys with unchanged values.
        cs$h|]}�j|�j|kr|�qSrr7r8r3rrr:r;z'DictDiffer.unchanged.<locals>.<setcomp>r<r3rr3r�	unchanged�r=zDictDiffer.unchangedN)
�__name__�
__module__�__qualname__�__doc__r2r"rrrr>rrrrr!�s	
r!)rN)NrN)
rB�logging�	getLoggerr?rrrrr%r!rrrr�<module>s

	
>
9@