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

�N�ga�@s*dZdd�Zdd�Zd
dd�Zdd	�ZdS)z�
Management of Gentoo make.conf
==============================

A state module to manage Gentoo's ``make.conf`` file

.. code-block:: yaml

    makeopts:
      makeconf.present:
        - value: '-j3'
cCsdtvrdSdS)zC
    Only load if the makeconf module is available in __salt__
    �makeconf.get_varZmakeconf)Fz#makeconf module could not be loaded)�__salt__�rr�H/opt/saltstack/salt/lib/python3.10/site-packages/salt/states/makeconf.py�__virtual__srcCsB|durt�St|t�st|t�r|��}t|�St|�}t|�S)z
    Force var to be a set
    N)�set�
isinstance�list�str�split)�varrrr�	_make_sets

�rNcCs,id|dd�}|��}td|�}|durh|durh|durh|dur,d}|�|�|d<|Stdr?d	}|�|�|d<d|d
<|Std|d�}||ddur]d
}|�|�|d<d|d
<|Sd}|�|�|d<|S|dur�|dur�||kr�d}|�||�|d<|Stdr�d}|�||�|d<d|d
<|Std||�}td|�}	|	dus�|	|kr�d
}|�|�|d<d|d
<|Sd}||d<|�|�|d<|S|dus�|du�r�t|�}
t|�}t|�}t|
�|��dkr�d}|�|�|d<d|d
<|St�}
t�}|du�r|
�|�}
|du�r|�|�}t|
�dk�r't|�dk�r'd}|�|�|d<|Std�rbd|�d�}t|
�dk�rC|dt	|
��d�7}t|�dk�rT|dt	|��d�7}|d7}||d<d|d
<|S|
D]
}td||��qd|D]
}td||��qqtd|�}	|||	d�i|d<d}|�|�|d<|S) aB
    Verify that the variable is in the ``make.conf`` and has the provided
    settings. If value is set, contains and excludes will be ignored.

    name
        The variable name. This will automatically be converted to upper
        case since variables in ``make.conf`` are in upper case

    value
        Enforce that the value of the variable is set to the provided value

    contains
        Enforce that the value of the variable contains the provided value

    excludes
        Enforce that the value of the variable does not contain the provided
        value.
    �T��changes�comment�name�resultrNz,Variable {0} is already present in make.confr�testz&Variable {0} is to be set in make.confrzmakeconf.set_var�newz*Variable {0} failed to be set in make.confFzVariable {0} set in make.confz*Variable {0} is already "{1}" in make.confz/Variable {0} is to be set to "{1}" in make.confz Variable {0} is set in make.confr�z6Variable {0} cannot contain and exclude the same valuez$Variable {0} is correct in make.confz	Variable z
 is set toz	 append "�"z trim "z
 in make.confzmakeconf.append_varzmakeconf.trim_var)�oldr)
�upperr�format�__opts__r�len�intersectionr�
differencer)r�value�containsZexcludes�ret�
upper_name�	old_value�msgr�	new_valueZcontains_setZexcludes_setZ
old_value_setZ	to_appendZto_trimrrr�present&s�T�O�G�D�>�9�0�,�"�




��r%cCs�id|dd�}|��}td|�}|dur d}|�|�|d<|Stdr3d	}|�|�|d<d|d
<|Std|�td|�}|durRd}|�|�|d<d
|d
<|Sd}|�|�|d<d|d
<|S)z�
    Verify that the variable is not in the ``make.conf``.

    name
        The variable name. This will automatically be converted to upper
        case since variables in ``make.conf`` are in upper case
    r
TrrNz-Variable {0} is already absent from make.confrrz0Variable {0} is set to be removed from make.confrzmakeconf.remove_varz0Variable {0} failed to be removed from make.confFz'Variable {0} was removed from make.conf)rrrr)rr r!r"r#r$rrr�absent�s.�
��r&)NNN)�__doc__rrr%r&rrrr�<module>s
	
x