HEX
Server: Apache
System: Linux server2.voipitup.com.au 4.18.0-553.104.1.lve.el8.x86_64 #1 SMP Tue Feb 10 20:07:30 UTC 2026 x86_64
User: posscale (1027)
PHP: 8.2.29
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/__pycache__/locate.cpython-310.pyc
o

�N�g0
�@sLdZddlZddlZe�e�Zdd�Zdd�Zdd�Z	d	d
�Z
ddd
�ZdS)z'
Module for using the locate utilities
�NcCstjj��rdSdS)z)
    Only work on POSIX-like systems
    )FzTThe locate execution module cannot be loaded: only available on non-Windows systems.T)�salt�utils�platformZ
is_windows�rr�G/opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/locate.py�__virtual__srcC�d}td|���}|S)zt
    Returns the version of locate

    CLI Example:

    .. code-block:: bash

        salt '*' locate.version
    z	locate -V�cmd.run��__salt__�
splitlines��cmd�outrrr�version�
rcCsli}d}td|���}|D]%}|����}|�d�r&|d�dd�|d<q|d|d	�|dd
��<q|S)z�
    Returns statistics about the locate database

    CLI Example:

    .. code-block:: bash

        salt '*' locate.stats
    z	locate -Sr	ZDatabase��:��databaser� N)rr�strip�split�
startswith�replace�join)�retrr�line�compsrrr�stats(s

rcCr)zs
    Updates the locate database

    CLI Example:

    .. code-block:: bash

        salt '*' locate.updatedb
    �updatedbr	r
r
rrrr >rr rc	Ks�d}dddddddd	�}|D]}t||�d
ur"||vr"|||7}q|r*d|��}|r3|d|��7}|d
kr>|d|��7}d|vrNt|d�d
urN|d7}d|�d|��}td|dd���}|S)a�
    Performs a file lookup. Valid options (and their defaults) are::

        basename=False
        count=False
        existing=False
        follow=True
        ignore=False
        nofollow=False
        wholename=True
        regex=False
        database=<locate's default database>
        limit=<integer, not set by default>

    See the manpage for ``locate(1)`` for further explanation of these options.

    CLI Example:

    .. code-block:: bash

        salt '*' locate.locate
    r�b�c�e�L�i�P�w)�basename�count�existing�follow�ignoreZnofollowZ	wholenameT�-z -d rz -l Zregexz --regexzlocate rr	F)Zpython_shell)�boolrr)	�patternr�limit�kwargs�optionsZtoggles�optionrrrrr�locateMs0�	�
r4)rr)�__doc__�loggingZsalt.utils.platformr�	getLogger�__name__�logrrrr r4rrrr�<module>s