%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python2.7/site-packages/salt/modules/
Upload File :
Create Path :
Current File : //lib/python2.7/site-packages/salt/modules/gentoolkitmod.pyo

�
���^c@@s�dZddlmZmZmZddlZeZy,ddlm	Z	m
Z
mZmZ
eZWnek
rsnXdZd�Zdd�Zd�Zd	�Zeedded
d�Zeeddd
�Zd�Zd�ZdS(u
Support for Gentoolkit

i(tabsolute_importtprint_functiontunicode_literalsN(tsearchtcleantclitexcludeu
gentoolkitcC@s$tddkrtrtStdfS(u?
    Only work on Gentoo systems with gentoolkit installed
    uosuGentoou�The gentoolkitmod execution module cannot be loaded: either the system is not Gentoo or the gentoolkit.eclean python module not available(t
__grains__tHAS_GENTOOLKITt__virtualname__tFalse(((s>/usr/lib/python2.7/site-packages/salt/modules/gentoolkitmod.pyt__virtual__scC@sBd}|dk	r(|dj|�7}ntd|dt�dkS(uG
    Fix up broken reverse dependencies

    lib
        Search for reverse dependencies for a particular library rather
        than every library on the system. It can be a full path to a
        library or basic regular expression.

    CLI Example:

    .. code-block:: bash

        salt '*' gentoolkit.revdep_rebuild
    u'revdep-rebuild -i --quiet --no-progressu --library={0}ucmd.retcodetpython_shelliN(tNonetformatt__salt__R
(tlibtcmd((s>/usr/lib/python2.7/site-packages/salt/modules/gentoolkitmod.pytrevdep_rebuild!scC@sbddddg}x0t|�rD|dkrD|d}|j�qWdjt|d�|d	�S(
u4
    Print sizes in a similar fashion as eclean
    u Gu Mu Ku Bi�g�@u{0}{1}ii����(tlentpopRtround(tsizetunits((s>/usr/lib/python2.7/site-packages/salt/modules/gentoolkitmod.pyt_pretty_size6s

cC@s7tjj|�r*tj|d��}n	t�}|S(um
    Parse an exclude file.

    Returns a dict as defined in gentoolkit.eclean.exclude.parseExcludeFile
    cS@sdS(N(R
(tx((s>/usr/lib/python2.7/site-packages/salt/modules/gentoolkitmod.pyt<lambda>Hs(tostpathtisfilet
excludemodtparseExcludeFiletdict(texclude_fileR((s>/usr/lib/python2.7/site-packages/salt/modules/gentoolkitmod.pyt_parse_excludeAs	u/etc/eclean/distfiles.excludec
@sM|dkrd}n@yt|�}Wn-tjk
rT}idj|�|6}|SX|dkrstj|�}n|dkr�tj|�}nd}	tj	d��}
|
j
d|d|d|d|d|d	|�\}}}
t���fd
�}|r!tj
|�}|j|�}	ni�d6|d6|
d
6t|	�d6}|S(ui
    Clean obsolete portage sources

    destructive
        Only keep minimum for reinstallation

    package_names
        Protect all versions of installed packages. Only meaningful if used
        with destructive=True

    size_limit <size>
        Don't delete distfiles bigger than <size>.
        <size> is a size specification: "10M" is "ten megabytes",
        "200K" is "two hundreds kilobytes", etc. Units are: G, M, K and B.

    time_limit <time>
        Don't delete distfiles files modified since <time>
        <time> is an amount of time: "1y" is "one year", "2w" is
        "two weeks", etc. Units are: y (years), m (months), w (weeks),
        d (days) and h (hours).

    fetch_restricted
        Protect fetch-restricted files. Only meaningful if used with
        destructive=True

    exclude_file
        Path to exclusion file. Default is /etc/eclean/distfiles.exclude
        This is the same default eclean-dist uses. Use None if this file
        exists and you want to ignore.

    Returns a dict containing the cleaned, saved, and deprecated dists:

    .. code-block:: python

        {'cleaned': {<dist file>: <size>},
         'deprecated': {<package>: <dist file>},
         'saved': {<package>: <dist file>},
         'total_cleaned': <size>}

    CLI Example:

    .. code-block:: bash

        salt '*' gentoolkit.eclean_dist destructive=True
    uInvalid exclusion file: {0}icS@sdS(N(R
(R((s>/usr/lib/python2.7/site-packages/salt/modules/gentoolkitmod.pyR�stdestructivet
package_namest
size_limitt
time_limittfetch_restrictedRc@st|��|<tS(N(RtTrue(Rtkeytargs(tcleaned(s>/usr/lib/python2.7/site-packages/salt/modules/gentoolkitmod.pyt_eclean_progress_controller�sucleanedusavedu
deprecatedu
total_cleanedN(R
R"RtParseExcludeFileExceptionRRt	parseTimet	parseSizeRtDistfilesSearcht
findDistfilesR RtCleanUpt
clean_distR(R#R$R%R&R'R!Rtetrett
clean_sizetenginetclean_metsavedt
deprecatedR,tcleaner((R+s>/usr/lib/python2.7/site-packages/salt/modules/gentoolkitmod.pyteclean_distNs20			u/etc/eclean/packages.excludec@s|dkrd}n@yt|�}Wn-tjk
rT}idj|�|6}|SX|dkrstj|�}nd}tjdd|d|d|d|dtj	�}t
���fd�}	|r�tj|	�}
|
j
|tj	�}ni�d	6t|�d
6}|S(u�
    Clean obsolete binary packages

    destructive
        Only keep minimum for reinstallation

    package_names
        Protect all versions of installed packages. Only meaningful if used
        with destructive=True

    time_limit <time>
        Don't delete distfiles files modified since <time>
        <time> is an amount of time: "1y" is "one year", "2w" is
        "two weeks", etc. Units are: y (years), m (months), w (weeks),
        d (days) and h (hours).

    exclude_file
        Path to exclusion file. Default is /etc/eclean/packages.exclude
        This is the same default eclean-pkg uses. Use None if this file
        exists and you want to ignore.

    Returns a dict containing the cleaned binary packages:

    .. code-block:: python

        {'cleaned': {<dist file>: <size>},
         'total_cleaned': <size>}

    CLI Example:

    .. code-block:: bash

        salt '*' gentoolkit.eclean_pkg destructive=True
    uInvalid exclusion file: {0}iR#R$R&Rtpkgdirc@st|��|<tS(N(RR((RR)R*(R+(s>/usr/lib/python2.7/site-packages/salt/modules/gentoolkitmod.pyR,�sucleanedu
total_cleanedN(R
R"RR-RRR.RtfindPackagesR=R RR2t
clean_pkgsR(R#R$R&R!RR4R5R6R8R,R;((R+s>/usr/lib/python2.7/site-packages/salt/modules/gentoolkitmod.pyt
eclean_pkg�s,$		
cC@s�t�}x�|D]�}y�|jdd�\}}}d|krM|d7}n2d|krf|d7}nd|kr|d7}nd|kr�|jdd	�\}}|jd
�}n	t�}i|d6|d6|d
6||<Wqtk
r�qXqW|S(u�
    Process output from glsa_check_list into a dict

    Returns a dict containing the glsa id, description, status, and CVEs
    iuUu
 Not AffecteduNu Might be AffecteduAu Applied (injected)uCVEiu,udescriptionustatusuCVEsN(R tsplitR
trsplittlistt
ValueError(toutputR5tlinetglsa_idtstatustdesctcves((s>/usr/lib/python2.7/site-packages/salt/modules/gentoolkitmod.pyt_glsa_list_process_output�s&	



	
cC@s�d}t|t�r7xD|D]}||d7}qWn%|dksO|dkr\||7}nt�}td|dt�jd�}t|�}|S(u#
    List the status of Gentoo Linux Security Advisories

    glsa_list
         can contain an arbitrary number of GLSA ids, filenames
         containing GLSAs or the special identifiers 'all' and 'affected'

    Returns a dict containing glsa ids with a description, status, and CVEs:

    .. code-block:: python

        {<glsa_id>: {'description': <glsa_description>,
         'status': <glsa status>,
         'CVEs': [<list of CVEs>]}}

    CLI Example:

    .. code-block:: bash

        salt '*' gentoolkit.glsa_check_list 'affected'
    u*glsa-check --quiet --nocolor --cve --list u ualluaffecteducmd.runRu
(t
isinstanceRCR RR
RARK(t	glsa_listRtglsaR5tout((s>/usr/lib/python2.7/site-packages/salt/modules/gentoolkitmod.pytglsa_check_lists

	(t__doc__t
__future__RRRRR
Rtgentoolkit.ecleanRRRRRR(tImportErrorR	RR
RRR"R<R@RKRP(((s>/usr/lib/python2.7/site-packages/salt/modules/gentoolkitmod.pyt<module>s("

	
		
	R	F	

Zerion Mini Shell 1.0