%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib/python2.7/site-packages/salt/modules/
Upload File :
Create Path :
Current File : //usr/lib/python2.7/site-packages/salt/modules/makeconf.pyc

�
���^c@@s�dZddlmZmZmZddlZddlZd�Zd�Z	d�Z
d�Zd�Zd	�Z
d
�Zd�Zd�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z d�Z!d�Z"d�Z#d �Z$d!�Z%d"�Z&d#�Z'd$�Z(d%�Z)d&�Z*d'�Z+d(�Z,d)�Z-d*�Z.d+�Z/d,�Z0d-�Z1d.�Z2d/�Z3dS(0u/
Support for modifying make.conf under Gentoo

i(tabsolute_importtprint_functiontunicode_literalsNcC@stddkrdStdfS(u
    Only work on Gentoo
    uosuGentooumakeconfuQThe makeconf execution module cannot be loaded: only available on Gentoo systems.(t
__grains__tFalse(((s9/usr/lib/python2.7/site-packages/salt/modules/makeconf.pyt__virtual__scC@s8d}d}td|�r |Std|�r4|SdS(u�
    Find the correct make.conf. Gentoo recently moved the make.conf
    but still supports the old location, using the old location first
    u/etc/make.confu/etc/portage/make.confufile.file_existsN(t__salt__(told_conftnew_conf((s9/usr/lib/python2.7/site-packages/salt/modules/makeconf.pyt
_get_makeconfscC@s�t�}d}dj||�}td||�rodddj|jdd�|�|g}td	|�ntd
||�dS(u�
    Add a new var to the make.conf. If using layman, the source line
    for the layman make.conf needs to be at the very end of the
    config. This ensures that the new var will be above the source
    line.
    u source /var/lib/layman/make.confu	{0}="{1}"u
file.containsusedu-iu/{0}/ i\{1}u/u\/ucmd.runufile.appendN(R	tformatRtreplace(tvartvaluetmakeconftlaymantfullvartcmd((s9/usr/lib/python2.7/site-packages/salt/modules/makeconf.pyt_add_var$s		cC@st�}t|�}|dk	rMtd|dj|�dj||��n
t||�t|�}ii|d6|d6|6S(u 
    Set a variable in the make.conf

    Return a dict containing the new value for variable::

        {'<variable>': {'old': '<old-value>',
                        'new': '<new-value>'}}

    CLI Example:

    .. code-block:: bash

        salt '*' makeconf.set_var 'LINGUAS' 'en'
    ufile.sedu^{0}=.*u	{0}="{1}"uoldunewN(R	tget_vartNoneRR
R(RR
Rt	old_valuet	new_value((s9/usr/lib/python2.7/site-packages/salt/modules/makeconf.pytset_var9s	%
cC@sft�}t|�}|dk	rAtd|dj|�d�nt|�}ii|d6|d6|6S(u'
    Remove a variable from the make.conf

    Return a dict containing the new value for the variable::

        {'<variable>': {'old': '<old-value>',
                        'new': '<new-value>'}}

    CLI Example:

    .. code-block:: bash

        salt '*' makeconf.remove_var 'LINGUAS'
    ufile.sedu^{0}=.*uuoldunewN(R	RRRR
(RRRR((s9/usr/lib/python2.7/site-packages/salt/modules/makeconf.pyt
remove_varXs	 cC@s�t�}t|�}|dk	r_dj||�}td|dj|�dj||��n
t||�t|�}ii|d6|d6|6S(u4
    Add to or create a new variable in the make.conf

    Return a dict containing the new value for variable::

        {'<variable>': {'old': '<old-value>',
                        'new': '<new-value>'}}

    CLI Example:

    .. code-block:: bash

        salt '*' makeconf.append_var 'LINGUAS' 'en'
    u{0} {1}ufile.sedu^{0}=.*u	{0}="{1}"uoldunewN(R	RRR
RR(RR
RRtappended_valueR((s9/usr/lib/python2.7/site-packages/salt/modules/makeconf.pyt
append_varss	
cC@sct�}t|�}|dk	r>td||dd|�nt|�}ii|d6|d6|6S(u1
    Remove a value from a variable in the make.conf

    Return a dict containing the new value for variable::

        {'<variable>': {'old': '<old-value>',
                        'new': '<new-value>'}}

    CLI Example:

    .. code-block:: bash

        salt '*' makeconf.trim_var 'LINGUAS' 'en'
    ufile.sedutlimituoldunewN(R	RRR(RR
RRR((s9/usr/lib/python2.7/site-packages/salt/modules/makeconf.pyttrim_var�s	cC@s�t�}tjjj|��"}tjjj|j��}WdQXx�|D]}|j|�rI|j	dd�d}d|kr�|j	d�d}n"d|kr�|j	d�d}n|j
�}|SqIWdS(u�
    Get the value of a variable in make.conf

    Return the value of the variable or None if the variable is not in
    make.conf

    CLI Example:

    .. code-block:: bash

        salt '*' makeconf.get_var 'LINGUAS'
    Nu=iu"u#i(R	tsalttutilstfilestfopentdatatdecodet	readlinest
startswithtsplittstripR(RRtfn_t	conf_filetlinetret((s9/usr/lib/python2.7/site-packages/salt/modules/makeconf.pyR�s
	!
cC@s>t|�}|jdd�}|dkr.tS||j�kS(u�
    Verify if variable contains a value in make.conf

    Return True if value is set for var

    CLI Example:

    .. code-block:: bash

        salt '*' makeconf.var_contains 'LINGUAS' 'en'
    u\uN(RRRRR%(RR
tsetval((s9/usr/lib/python2.7/site-packages/salt/modules/makeconf.pytvar_contains�s
cC@s
td|�S(u&
    Set the CFLAGS variable

    Return a dict containing the new value for variable::

        {'<variable>': {'old': '<old-value>',
                        'new': '<new-value>'}}

    CLI Example:

    .. code-block:: bash

        salt '*' makeconf.set_cflags '-march=native -O2 -pipe'
    uCFLAGS(R(R
((s9/usr/lib/python2.7/site-packages/salt/modules/makeconf.pyt
set_cflags�scC@s
td�S(u�
    Get the value of CFLAGS variable in the make.conf

    Return the value of the variable or None if the variable is
    not in the make.conf

    CLI Example:

    .. code-block:: bash

        salt '*' makeconf.get_cflags
    uCFLAGS(R(((s9/usr/lib/python2.7/site-packages/salt/modules/makeconf.pyt
get_cflags�s
cC@s
td|�S(u.
    Add to or create a new CFLAGS in the make.conf

    Return a dict containing the new value for variable::

        {'<variable>': {'old': '<old-value>',
                        'new': '<new-value>'}}

    CLI Example:

    .. code-block:: bash

        salt '*' makeconf.append_cflags '-pipe'
    uCFLAGS(R(R
((s9/usr/lib/python2.7/site-packages/salt/modules/makeconf.pyt
append_cflagsscC@s
td|�S(u2
    Remove a value from CFLAGS variable in the make.conf

    Return a dict containing the new value for variable::

        {'<variable>': {'old': '<old-value>',
                        'new': '<new-value>'}}

    CLI Example:

    .. code-block:: bash

        salt '*' makeconf.trim_cflags '-pipe'
    uCFLAGS(R(R
((s9/usr/lib/python2.7/site-packages/salt/modules/makeconf.pyttrim_cflagsscC@s
td|�S(u�
    Verify if CFLAGS variable contains a value in make.conf

    Return True if value is set for var

    CLI Example:

    .. code-block:: bash

        salt '*' makeconf.cflags_contains '-pipe'
    uCFLAGS(R,(R
((s9/usr/lib/python2.7/site-packages/salt/modules/makeconf.pytcflags_contains$scC@s
td|�S(u*
    Set the CXXFLAGS variable

    Return a dict containing the new value for variable::

        {'<variable>': {'old': '<old-value>',
                        'new': '<new-value>'}}

    CLI Example:

    .. code-block:: bash

        salt '*' makeconf.set_cxxflags '-march=native -O2 -pipe'
    uCXXFLAGS(R(R
((s9/usr/lib/python2.7/site-packages/salt/modules/makeconf.pytset_cxxflags3scC@s
td�S(u�
    Get the value of CXXFLAGS variable in the make.conf

    Return the value of the variable or None if the variable is
    not in the make.conf

    CLI Example:

    .. code-block:: bash

        salt '*' makeconf.get_cxxflags
    uCXXFLAGS(R(((s9/usr/lib/python2.7/site-packages/salt/modules/makeconf.pytget_cxxflagsEs
cC@s
td|�S(u2
    Add to or create a new CXXFLAGS in the make.conf

    Return a dict containing the new value for variable::

        {'<variable>': {'old': '<old-value>',
                        'new': '<new-value>'}}

    CLI Example:

    .. code-block:: bash

        salt '*' makeconf.append_cxxflags '-pipe'
    uCXXFLAGS(R(R
((s9/usr/lib/python2.7/site-packages/salt/modules/makeconf.pytappend_cxxflagsUscC@s
td|�S(u6
    Remove a value from CXXFLAGS variable in the make.conf

    Return a dict containing the new value for variable::

        {'<variable>': {'old': '<old-value>',
                        'new': '<new-value>'}}

    CLI Example:

    .. code-block:: bash

        salt '*' makeconf.trim_cxxflags '-pipe'
    uCXXFLAGS(R(R
((s9/usr/lib/python2.7/site-packages/salt/modules/makeconf.pyt
trim_cxxflagsgscC@s
td|�S(u�
    Verify if CXXFLAGS variable contains a value in make.conf

    Return True if value is set for var

    CLI Example:

    .. code-block:: bash

        salt '*' makeconf.cxxflags_contains '-pipe'
    uCXXFLAGS(R,(R
((s9/usr/lib/python2.7/site-packages/salt/modules/makeconf.pytcxxflags_containsyscC@s
td|�S(u 
    Set the CHOST variable

    Return a dict containing the new value for variable::

        {'<variable>': {'old': '<old-value>',
                        'new': '<new-value>'}}

    CLI Example:

    .. code-block:: bash

        salt '*' makeconf.set_chost 'x86_64-pc-linux-gnu'
    uCHOST(R(R
((s9/usr/lib/python2.7/site-packages/salt/modules/makeconf.pyt	set_chost�scC@s
td�S(u�
    Get the value of CHOST variable in the make.conf

    Return the value of the variable or None if the variable is
    not in the make.conf

    CLI Example:

    .. code-block:: bash

        salt '*' makeconf.get_chost
    uCHOST(R(((s9/usr/lib/python2.7/site-packages/salt/modules/makeconf.pyt	get_chost�s
cC@s
td|�S(u�
    Verify if CHOST variable contains a value in make.conf

    Return True if value is set for var

    CLI Example:

    .. code-block:: bash

        salt '*' makeconf.chost_contains 'x86_64-pc-linux-gnu'
    uCHOST(R,(R
((s9/usr/lib/python2.7/site-packages/salt/modules/makeconf.pytchost_contains�scC@s
td|�S(u
    Set the MAKEOPTS variable

    Return a dict containing the new value for variable::

        {'<variable>': {'old': '<old-value>',
                        'new': '<new-value>'}}

    CLI Example:

    .. code-block:: bash

        salt '*' makeconf.set_makeopts '-j3'
    uMAKEOPTS(R(R
((s9/usr/lib/python2.7/site-packages/salt/modules/makeconf.pytset_makeopts�scC@s
td�S(u�
    Get the value of MAKEOPTS variable in the make.conf

    Return the value of the variable or None if the variable is
    not in the make.conf

    CLI Example:

    .. code-block:: bash

        salt '*' makeconf.get_makeopts
    uMAKEOPTS(R(((s9/usr/lib/python2.7/site-packages/salt/modules/makeconf.pytget_makeopts�s
cC@s
td|�S(u0
    Add to or create a new MAKEOPTS in the make.conf

    Return a dict containing the new value for variable::

        {'<variable>': {'old': '<old-value>',
                        'new': '<new-value>'}}

    CLI Example:

    .. code-block:: bash

        salt '*' makeconf.append_makeopts '-j3'
    uMAKEOPTS(R(R
((s9/usr/lib/python2.7/site-packages/salt/modules/makeconf.pytappend_makeopts�scC@s
td|�S(u4
    Remove a value from MAKEOPTS variable in the make.conf

    Return a dict containing the new value for variable::

        {'<variable>': {'old': '<old-value>',
                        'new': '<new-value>'}}

    CLI Example:

    .. code-block:: bash

        salt '*' makeconf.trim_makeopts '-j3'
    uMAKEOPTS(R(R
((s9/usr/lib/python2.7/site-packages/salt/modules/makeconf.pyt
trim_makeopts�scC@s
td|�S(u�
    Verify if MAKEOPTS variable contains a value in make.conf

    Return True if value is set for var

    CLI Example:

    .. code-block:: bash

        salt '*' makeconf.makeopts_contains '-j3'
    uMAKEOPTS(R,(R
((s9/usr/lib/python2.7/site-packages/salt/modules/makeconf.pytmakeopts_contains�scC@s
td|�S(u/
    Set the EMERGE_DEFAULT_OPTS variable

    Return a dict containing the new value for variable::

        {'<variable>': {'old': '<old-value>',
                        'new': '<new-value>'}}

    CLI Example:

    .. code-block:: bash

        salt '*' makeconf.set_emerge_default_opts '--jobs'
    uEMERGE_DEFAULT_OPTS(R(R
((s9/usr/lib/python2.7/site-packages/salt/modules/makeconf.pytset_emerge_default_optsscC@s
td�S(u
    Get the value of EMERGE_DEFAULT_OPTS variable in the make.conf

    Return the value of the variable or None if the variable is
    not in the make.conf

    CLI Example:

    .. code-block:: bash

        salt '*' makeconf.get_emerge_default_opts
    uEMERGE_DEFAULT_OPTS(R(((s9/usr/lib/python2.7/site-packages/salt/modules/makeconf.pytget_emerge_default_opts s
cC@s
td|�S(uI
    Add to or create a new EMERGE_DEFAULT_OPTS in the make.conf

    Return a dict containing the new value for variable::

        {'<variable>': {'old': '<old-value>',
                        'new': '<new-value>'}}

    CLI Example:

    .. code-block:: bash

        salt '*' makeconf.append_emerge_default_opts '--jobs'
    uEMERGE_DEFAULT_OPTS(R(R
((s9/usr/lib/python2.7/site-packages/salt/modules/makeconf.pytappend_emerge_default_opts0scC@s
td|�S(uM
    Remove a value from EMERGE_DEFAULT_OPTS variable in the make.conf

    Return a dict containing the new value for variable::

        {'<variable>': {'old': '<old-value>',
                        'new': '<new-value>'}}

    CLI Example:

    .. code-block:: bash

        salt '*' makeconf.trim_emerge_default_opts '--jobs'
    uEMERGE_DEFAULT_OPTS(R(R
((s9/usr/lib/python2.7/site-packages/salt/modules/makeconf.pyttrim_emerge_default_optsBscC@s
td|�S(u�
    Verify if EMERGE_DEFAULT_OPTS variable contains a value in make.conf

    Return True if value is set for var

    CLI Example:

    .. code-block:: bash

        salt '*' makeconf.emerge_default_opts_contains '--jobs'
    uEMERGE_DEFAULT_OPTS(R,(R
((s9/usr/lib/python2.7/site-packages/salt/modules/makeconf.pytemerge_default_opts_containsTscC@s
td|�S(u:
    Set the GENTOO_MIRRORS variable

    Return a dict containing the new value for variable::

        {'<variable>': {'old': '<old-value>',
                        'new': '<new-value>'}}

    CLI Example:

    .. code-block:: bash

        salt '*' makeconf.set_gentoo_mirrors 'http://distfiles.gentoo.org'
    uGENTOO_MIRRORS(R(R
((s9/usr/lib/python2.7/site-packages/salt/modules/makeconf.pytset_gentoo_mirrorscscC@s
td�S(u�
    Get the value of GENTOO_MIRRORS variable in the make.conf

    Return the value of the variable or None if the variable is
    not in the make.conf

    CLI Example:

    .. code-block:: bash

        salt '*' makeconf.get_gentoo_mirrors
    uGENTOO_MIRRORS(R(((s9/usr/lib/python2.7/site-packages/salt/modules/makeconf.pytget_gentoo_mirrorsus
cC@s
td|�S(uT
    Add to or create a new GENTOO_MIRRORS in the make.conf

    Return a dict containing the new value for variable::

        {'<variable>': {'old': '<old-value>',
                        'new': '<new-value>'}}

    CLI Example:

    .. code-block:: bash

        salt '*' makeconf.append_gentoo_mirrors 'http://distfiles.gentoo.org'
    uGENTOO_MIRRORS(R(R
((s9/usr/lib/python2.7/site-packages/salt/modules/makeconf.pytappend_gentoo_mirrors�scC@s
td|�S(uX
    Remove a value from GENTOO_MIRRORS variable in the make.conf

    Return a dict containing the new value for variable::

        {'<variable>': {'old': '<old-value>',
                        'new': '<new-value>'}}

    CLI Example:

    .. code-block:: bash

        salt '*' makeconf.trim_gentoo_mirrors 'http://distfiles.gentoo.org'
    uGENTOO_MIRRORS(R(R
((s9/usr/lib/python2.7/site-packages/salt/modules/makeconf.pyttrim_gentoo_mirrors�scC@s
td|�S(u�
    Verify if GENTOO_MIRRORS variable contains a value in make.conf

    Return True if value is set for var

    CLI Example:

    .. code-block:: bash

        salt '*' makeconf.gentoo_mirrors_contains 'http://distfiles.gentoo.org'
    uGENTOO_MIRRORS(R,(R
((s9/usr/lib/python2.7/site-packages/salt/modules/makeconf.pytgentoo_mirrors_contains�scC@s
td|�S(u;
    Set the SYNC variable

    Return a dict containing the new value for variable::

        {'<variable>': {'old': '<old-value>',
                        'new': '<new-value>'}}

    CLI Example:

    .. code-block:: bash

        salt '*' makeconf.set_sync 'rsync://rsync.namerica.gentoo.org/gentoo-portage'
    uSYNC(R(R
((s9/usr/lib/python2.7/site-packages/salt/modules/makeconf.pytset_sync�scC@s
td�S(u�
    Get the value of SYNC variable in the make.conf

    Return the value of the variable or None if the variable is
    not in the make.conf

    CLI Example:

    .. code-block:: bash

        salt '*' makeconf.get_sync
    uSYNC(R(((s9/usr/lib/python2.7/site-packages/salt/modules/makeconf.pytget_sync�s
cC@s
td|�S(u�
    Verify if SYNC variable contains a value in make.conf

    Return True if value is set for var

    CLI Example:

    .. code-block:: bash

        salt '*' makeconf.sync_contains 'rsync://rsync.namerica.gentoo.org/gentoo-portage'
    uSYNC(R,(R
((s9/usr/lib/python2.7/site-packages/salt/modules/makeconf.pyt
sync_contains�scC@s
td�S(u�
    Get the value of FEATURES variable in the make.conf

    Return the value of the variable or None if the variable is
    not in the make.conf

    CLI Example:

    .. code-block:: bash

        salt '*' makeconf.get_features
    uFEATURES(R(((s9/usr/lib/python2.7/site-packages/salt/modules/makeconf.pytget_features�s
cC@s
td|�S(u9
    Add to or create a new FEATURES in the make.conf

    Return a dict containing the new value for variable::

        {'<variable>': {'old': '<old-value>',
                        'new': '<new-value>'}}

    CLI Example:

    .. code-block:: bash

        salt '*' makeconf.append_features 'webrsync-gpg'
    uFEATURES(R(R
((s9/usr/lib/python2.7/site-packages/salt/modules/makeconf.pytappend_features�scC@s
td|�S(u=
    Remove a value from FEATURES variable in the make.conf

    Return a dict containing the new value for variable::

        {'<variable>': {'old': '<old-value>',
                        'new': '<new-value>'}}

    CLI Example:

    .. code-block:: bash

        salt '*' makeconf.trim_features 'webrsync-gpg'
    uFEATURES(R(R
((s9/usr/lib/python2.7/site-packages/salt/modules/makeconf.pyt
trim_featuresscC@s
td|�S(u�
    Verify if FEATURES variable contains a value in make.conf

    Return True if value is set for var

    CLI Example:

    .. code-block:: bash

        salt '*' makeconf.features_contains 'webrsync-gpg'
    uFEATURES(R,(R
((s9/usr/lib/python2.7/site-packages/salt/modules/makeconf.pytfeatures_containss(4t__doc__t
__future__RRRtsalt.utils.dataRtsalt.utils.filesRR	RRRRRRR,R-R.R/R0R1R2R3R4R5R6R7R8R9R:R;R<R=R>R?R@RARBRCRDRERFRGRHRIRJRKRLRMRNRO(((s9/usr/lib/python2.7/site-packages/salt/modules/makeconf.pyt<module>s^			
																																									

Zerion Mini Shell 1.0