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__/winrepo.cpython-310.pyc
o

�N�g�
�@sRdZddlZddlZddlZddlZddlZddlZddlZdd�Z	ddd�Z
dS)	z#
Manage Windows Package Repository
�NcCsdS)N�winrepo�rrr�G/opt/saltstack/salt/lib/python3.10/site-packages/salt/states/winrepo.py�__virtual__srFcCs�|didd�}tj�tj�tjjd��}|d}|d}tj�||�}d}|s�tj�|�s:d|d<|�d	�|d
<|Stj�|�sJd}|�d	�|d
<n;t�	|�t	j
}tjj�|�D]+\}	}
}t
�||
�D]}tj�|	|�}t�	|�t	j
|kr�d�||�|d
<d}nqdqYtdr�d
|d<|S|s�|s�|Stj�|�}
|
�dg�}d|i|d<t|t�r�|ikr�|s�t�|�d|d<d|d
<|S)a�
    Refresh the winrepo.p file of the repository (salt-run winrepo.genrepo)

    If ``force`` is ``True`` no checks will be made and the repository will be
    generated if ``allow_empty`` is ``True`` then the state will not return an
    error if there are 0 packages,

    .. note::

        This state only loads on minions that have the ``roles: salt-master``
        grain set.

    Example:

    .. code-block:: yaml

        winrepo:
          winrepo.genrepo
    T�)�name�result�changes�commentZmaster�winrepo_dir�winrepo_cachefileFrz is missingr
zmtime({}) < mtime({})�testNzwinrepo.genreporr	zwinrepo.genrepo returned empty)�saltZconfig�
master_config�os�path�joinZsyspathsZ
CONFIG_DIR�exists�stat�ST_MTIME�utilsZos_walk�	itertools�chain�formatZ__opts__�runnerZRunnerClient�cmd�
isinstance�dict�remove)r�forceZallow_empty�retrrrZexecuteZwinrepo_cachefile_mtime�root�dirs�files�	full_pathrZ
runner_retrrr�genreposR����
r%)FF)�__doc__rrrZsalt.configrZsalt.runnerZ
salt.syspathsZsalt.utils.pathrr%rrrr�<module>s