%PDF- %PDF-
Mini Shell

Mini Shell

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

�
���^c@@s�dZddlmZmZmZddlZddlZddlZddlZddl	Z
ddlZ
ddlZ
ddl
mZddlmZddlmZddlmZmZmZddlmZdd	lmZeee��Ze
jjj �r�dd
l!m"Z#ddlm$Z$ddl%Z%ddl&Z&ddl'Z'ddl(Z(ddl)m*Z*dd
l+m,Z,ddl+m-Z-ddl+m.Z.ddl+m/Z/ddl+m0Z0ddl+m1Z1ddl+m2Z2ddl+m3Z3ddl+m4Z4ee,e��Z,ee-e��Z-ee.e��Z.ee/e��Z/ee0e��Z0ee1e��Z1ee2e��Z2ee3e��Z3ee4e��Z4yddl5Z5Wne6k
r�ddl7Z5nXddlm8Z8nej9e:�Z;d�Z<d�Z=d�Z>e?e?d�Z@e?d�ZAd�ZBeCeCeCeDe?e?d�ZEeCeCd�ZFeCeCeCeDe?d�ZGeCeCeCeCe?e?eDe?e?e?d �
ZHe?eCd!�ZId"�ZJd#�ZKd$�ZLe?d%�ZMeCeCeCe?e?eCeCe?e?eDe?e?e?d&�
ZNeCeCeCeCd'�ZOeCeCd(�ZPeCd)�ZQeCeCe?eCeDd*�ZRd+eCeCeCeDe?d,�ZSeCeCeDe?d-�ZTeCeCeDe?d.�ZUe?eCd/�ZVeCeCd0�ZWd1�ZXd2�ZYd3�ZZdS(4u�	
Installation of packages using OS package managers such as yum or apt-get
=========================================================================

.. note::
    On minions running systemd>=205, as of version 2015.8.12, 2016.3.3, and
    2016.11.0, `systemd-run(1)`_ is now used to isolate commands which modify
    installed packages from the ``salt-minion`` daemon's control group. This is
    done to keep systemd from killing the package manager commands spawned by
    Salt, when Salt updates itself (see ``KillMode`` in the `systemd.kill(5)`_
    manpage for more information). If desired, usage of `systemd-run(1)`_ can
    be suppressed by setting a :mod:`config option <salt.modules.config.get>`
    called ``systemd.use_scope``, with a value of ``False`` (no quotes).

.. _`systemd-run(1)`: https://www.freedesktop.org/software/systemd/man/systemd-run.html
.. _`systemd.kill(5)`: https://www.freedesktop.org/software/systemd/man/systemd.kill.html

Salt can manage software packages via the pkg state module, packages can be
set up to be installed, latest, removed and purged. Package management
declarations are typically rather simple:

.. code-block:: yaml

    vim:
      pkg.installed

A more involved example involves pulling from a custom repository.

.. code-block:: yaml

    base:
      pkgrepo.managed:
        - humanname: Logstash PPA
        - name: ppa:wolfnet/logstash
        - dist: precise
        - file: /etc/apt/sources.list.d/logstash.list
        - keyid: 28B04E4A
        - keyserver: keyserver.ubuntu.com

    logstash:
      pkg.installed:
        - fromrepo: ppa:wolfnet/logstash

Multiple packages can also be installed with the use of the pkgs
state module

.. code-block:: yaml

    dotdeb.repo:
      pkgrepo.managed:
        - humanname: Dotdeb
        - name: deb http://packages.dotdeb.org wheezy-php55 all
        - dist: wheezy-php55
        - file: /etc/apt/sources.list.d/dotbeb.list
        - keyid: 89DF5277
        - keyserver: keys.gnupg.net
        - refresh_db: true

    php.packages:
      pkg.installed:
        - fromrepo: wheezy-php55
        - pkgs:
          - php5-fpm
          - php5-cli
          - php5-curl

.. warning::

    Package names are currently case-sensitive. If the minion is using a
    package manager which is not case-sensitive (such as :mod:`pkgng
    <salt.modules.pkgng>`), then this state will fail if the proper case is not
    used. This will be addressed in a future release of Salt.
i(tabsolute_importtprint_functiontunicode_literalsN(tnested(tnamespaced_function(tOrderedDict(tCommandExecutionErrortMinionErrortSaltInvocationError(t_repack_pkgs(tsix(turlparse(tSaltRenderError(t
cmp_to_key(t_get_package_info(t
get_repo_data(t_get_repo_details(t_refresh_db_conditional(t
refresh_db(tgenrepo(t_repo_process_pkg_sls(t_get_latest_pkg_version(t_reverse_cmp_pkg_versions(tLooseVersioncC@s
dtkS(un
    Only make these states available if a pkg provider has been detected or
    assigned for this minion
    upkg.install(t__salt__(((s3/usr/lib/python2.7/site-packages/salt/states/pkg.pyt__virtual__�scC@s@tjjj|j��\}}|dkr6d}n||fS(u�
    Return a tuple containing the comparison operator and the version. If no
    comparison operator was passed, the comparison is assumed to be an "equals"
    comparison, and "==" will be the operator returned.
    u=uu==(u=u(tsalttutilstpkgtsplit_comparisontstrip(tpkgvertopertverstr((s3/usr/lib/python2.7/site-packages/salt/states/pkg.pyt_get_comparison_spec�s!	cC@sSg}|j�}|s|Sx0|jd�D]}t|�}|j|�q,W|S(uF
    Returns a list of two-tuples containing (operator, version).
    u,(RtsplitR"tappend(tversion_conditions_stringtresulttversion_conditiontoperator_and_version((s3/usr/lib/python2.7/site-packages/salt/states/pkg.pyt_parse_version_string�sc	C@s�t|�}x�|D]{}t}xb|D]Z\}}|r_t|�dkr_|dkr_d}n|o}t|g||d|�}q&W|rtSqWtS(u
    Returns True if any of the installed versions match the specified version conditions,
    otherwise returns False.

    installed_versions
        The installed versions

    version_conditions_string
        The string containing all version conditions. E.G.
        1.2.3-4
        >=1.2.3-4
        >=1.2.3-4, <2.3.4-5
        >=1.2.3-4, <2.3.4-5, !=1.2.4-1

    ignore_epoch : False
        When a package version contains an non-zero epoch (e.g.
        ``1:3.14.159-2.el7``, and a specific version of a package is desired,
        set this option to ``True`` to ignore the epoch when comparing
        versions.

    allow_updates : False
        Allow the package to be updated outside Salt's control (e.g. auto updates on Windows).
        This means a package on the Minion can have a newer version than the latest available in
        the repository without enforcing a re-installation of the package.
        (Only applicable if only one strict version condition is specified E.G. version: 2.0.6~ubuntu3)
    iu==u>=tignore_epoch(R)tTruetlent_fulfills_version_spectFalse(	tinstalled_versionsR%R*t
allow_updatestversion_conditionstinstalled_versiont
fullfills_alltoperatortversion_string((s3/usr/lib/python2.7/site-packages/salt/states/pkg.pyt_fulfills_version_string�s
$	%cC@s�tjd�}tjjj�rLt|t�rLd|krL|d}qLnx`|D]X}|dkrwtj||�s�tjj	j
d|d|d|d|d|�rStSqSWtS(	up
    Returns True if any of the installed versions match the specified version,
    otherwise returns False
    upkg.version_cmpuversionu==tver1R tver2tcmp_funcR*(
RtgetRRtplatformt
is_freebsdt
isinstancetdicttfnmatchtversionstcompareR+R.(R@R tdesired_versionR*R9tver((s3/usr/lib/python2.7/site-packages/salt/states/pkg.pyR-�s
	cC@s0g|D]%}|tddt�kr|^qS(u/
    Find packages which are marked to be purged but can't yet be removed
    because they are dependencies for other installed packages. These are the
    packages which will need to be 'unpurged' because they are part of
    pkg.installed states. This really just applies to Debian-based Linuxes.
    u
pkg.list_pkgst
purge_desired(RR+(tdesiredtx((s3/usr/lib/python2.7/site-packages/salt/states/pkg.pyt_find_unpurge_targets�s
c	K@s�td�}|rNt|d|�}|s&i|d6id6td6dd6Sn�|rtjdd	��}	i||	|�6}n
i||6}|j|i�}
||kr&|
r�||
kr�i|d6id6td6d
j||�d6S|
r&|dkr&i|d6id6td6dj|�d6Snt}|sLyt||�}Wntk
rXqLXg}
|jd�r�|
j	d
jdj
t|d����n|jd�r�xFtj
|d�D].\}}|
j	dj|dj
|���q�Wn|
rLt|
�dkr|
j	d�ni|d6id6td6dj
|
�j�d6Sni}g}x�tj
|�D]�\}}|j|i�}
|
s�|||<qhn|
r�|r�qhnt}y,t|
j�|d|�s�|||<nWqhtk
r	}|j	|j�qhqhXqhW|r=i|d6id6td6dj
|�d6S|s~dj|rUdnd�}i|d6id6td6|d6S|S(u�
    Inspect the arguments to pkg.downloaded and discover what packages need to
    be downloaded. Return a dict of packages to download.
    upkg.list_downloadedt	normalizeunameuchangesuresultu3Invalidly formatted pkgs parameter. See minion log.ucommentupkg.normalize_namecS@s|S(N((tpkgname((s3/usr/lib/python2.7/site-packages/salt/states/pkg.pyt<lambda>su2Version {0} of package '{1}' is already downloadedu!Package {0} is already downloadedu
no_suggestubThe following package(s) were not found, and no possible matches were found in the package db: {0}u, usuggestu/Package '{0}' not found (possible matches: {1})iuu. R*u u0All specified packages{0} are already downloadedu (matching specified versions)N(RR	R.R:R+tformattNonet_preflight_checkRR$tjointsortedR
t	iteritemsR,trstripR6tkeyststrerror(tnametversiontpkgsRHtskip_suggestionsR*tkwargstcur_pkgstto_downloadt_normalize_nametcvertversion_spectproblemstcommentsRItsuggestionsttargetsRtexctmsg((s3/usr/lib/python2.7/site-packages/salt/states/pkg.pyt_find_download_targetss�





 




c	K@s�td�}|r|}nD|g}|j|i�r`i|d6id6td6dj|�d6Sg}x9|D]1}|j|i�}|sm|j|�qmqmqmW|s�d}i|d6id6td6|d6S|S(u�
    Inspect the arguments to pkg.patch_installed and discover what advisory
    patches need to be installed. Return a dict of advisory patches to install.
    upkg.list_installed_patchesunameuchangesuresultu'Advisory patch {0} is already installeducommentu4All specified advisory patches are already installed(RR:R+RKR$(	RTtadvisory_idsRXtcur_patchesRZRat
patch_nameR\Rc((s3/usr/lib/python2.7/site-packages/salt/states/pkg.pyt_find_advisory_targets{s.
		




cK@s]tddkrt|d<ntddt|�}|rtt|d|�}|s�i|d6id6td	6d
d6Sn(tjdd
��}i|||�6}t}	g}
g}x8tj|�D]'\}}
tt	j
d|��}tddkr3|r3gtj|�D]"\}}|d|kr|^q}n|j|g�}|sQq�n)td|
�dkrz|
j|�q�nt}	y<t
||
d|�r�|
j|�ntjd||
�Wq�tk
r�}|j|j�q�q�Xq�W|ri|d6id6td	6dj|�d6S|
sYdj|	r0dnd�}i|d6id6td	6|d6S|
S(u�
    Inspect the arguments to pkg.removed and discover what packages need to
    be removed. Return a dict of packages to remove.
    uosuFreeBSDuwith_originu
pkg.list_pkgstversions_as_listRHunameuchangesuresultu3Invalidly formatted pkgs parameter. See minion log.ucommentupkg.normalize_namecS@s|S(N((RI((s3/usr/lib/python2.7/site-packages/salt/states/pkg.pyRJ�su/uoriginupkg_resource.version_cleanR*uVCurrent version (%s) did not match desired version specification (%s), will not removeu u,All specified packages{0} are already absentu (matching specified versions)uN(t
__grains__R+RR	R.R:R
RPtbooltretsearchRLR$R6tlogtdebugRRSRNRK(RTRURVRHR*RXRYt	to_removeR[R]RaR^RIRtorigintktvR\RbRc((s3/usr/lib/python2.7/site-packages/salt/states/pkg.pyt_find_remove_targets�s`


;


c
6K@sft}t||f�r8i|d6id6td6dd6Si}t|t�r|td�|D��r|td�|D��}
ng}
t|t�r�td�|D��r�td	�|D��}ng}td
dkr�t|
d<ntj	j
j�r|	|
d
<n|
jdt�odt
k}y9t
ddt|
�}|rOt
d|
�pUt�}Wn3tk
r�}i|d6id6td6|jd6SXtj	j
j�r�|
jd
t�r�t}t}	nt||f�rX|r�t|d|�}n|rt
d|d|�}n|sIi|d6id6td6dj|r>dnd�d6St|�}n�tj	j
j�r�t|d|
d�}|s�i|d6id6td6dj|�d6S|dBkr�t|�}q�n|r�t
jdd��}i|||�6}n
i||6}t|�}ttjd|��}td
dkr�|r�gtj|�D]"\}}|d|krU|^qU}n|j|g�}||kr6|r�||kr�|r�|r�i|d6id6td6dj||�d6S|r6|dBkr6|r6|r6i|d6id6td6dj|�d6Snt}|s�|s�tg|j�D]C\}}||ko�|dBkp�t|||�sX||f^qX�}|r�yt||
�}Wntk
r�q�Xg}|jd �r|j d!jd"j!t"|d ����n|jd#�rjxFtj|d#�D].\}} |j d$j|d"j!| ���q5Wn|r�t#|�d%kr�|j d&�ni|d6id6td6d'j!|�j$�d6Sq�q�n|r�gn1gtj|�D]\}!}"|"d(kr�|!^q�}#|#r�t
d)d*|	|#|
�}$t#|#�d%krOi|$|#d+6}$n|	rdt}t}	nxF|$D]>}%|$|%sk|%|kr�||%d,|$|%<q�dB|$|%<qkqkW|j%|$�ni}&i}'g}g}(t})x�tj|�D]�\}*}+|j|*g�}|rD|rD|*|krD|j|j|*�d+g�}n|sZ|+|&|*<q�n|rv|rv|+|'|*<q�nd-t
kr�q�nd.},yt
d/|+d|
d�}-Wn/tk
r�}|j |,j|+|��q�nX|-s|j |,j|+d0��q�n.t&j'j(|-�s1|j d1j|+��q�nt
d-|-�}.|.dBkri|(j d2j|+��q�qF	|.d3}/n�|+}/|r�|+|'|*<q�nt
d4|*|+�s�|+|&|*<q�n�t
d5|+�dBkrF	|r�|r�y t
d6|*d7|
d8|�}0Wn%tt)fk
r	}|j})q�nX|0r@	|+|'|*<|0||*<q@	q�q�nt}1t|ob	|
jd9��}2yt||/d:|d;|2�}1Wn&tk
r�	}|j |j�q�nXt}|1s�|r�	|+|'|*<q
t*|+�}3|r_
td<�|3D��r_
y t
d6|*d7|
d8|�}0Wn%tt)fk
r>
}|j})q�nX|0r|
|+|'|*<|0||*<q|
q
t+j,d=||+�|+|&|*<q�q�W|)r�
|j |)�n|r�
i|d6id6td6d>j!|�d6St|&||'f�sMd?}4|4j|r�
|r�
d@nd&�}4i|d6id6td6|4d6}5|(rI|5j-dAg�j.|(�n|5S||&||'||(|fS(Cu�
    Inspect the arguments to pkg.installed and discover what packages need to
    be installed. Return a dict of desired packages
    unameuchangesuresultu.Only one of "pkgs" and "sources" is permitted.ucommentcs@s?|]5}t|t�rd|kr|jd�dk	VqdS(uignore_typesN(R=t_OrderedDictR:RL(t.0RF((s3/usr/lib/python2.7/site-packages/salt/states/pkg.pys	<genexpr>scs@s*|] }d|kr|jd�VqdS(uignore_typesN(R:(RvRF((s3/usr/lib/python2.7/site-packages/salt/states/pkg.pys	<genexpr>scs@s?|]5}t|t�rd|kr|jd�dk	VqdS(uverify_optionsN(R=RuR:RL(RvRF((s3/usr/lib/python2.7/site-packages/salt/states/pkg.pys	<genexpr>scs@s*|] }d|kr|jd�VqdS(uverify_optionsN(R:(RvRF((s3/usr/lib/python2.7/site-packages/salt/states/pkg.pys	<genexpr>suosuFreeBSDuwith_originurefreshuresolve_capabilitiesupkg.list_providesu
pkg.list_pkgsRiRHupkg_resource.pack_sourcesu4Invalidly formatted '{0}' parameter. See minion log.upkgsusourcestsaltenvusaltenvu(Package {0} not found in the repository.upkg.normalize_namecS@s|S(N((RI((s3/usr/lib/python2.7/site-packages/salt/states/pkg.pyRJ]su/uoriginu1Version {0} of package '{1}' is already installedu Package {0} is already installedu
no_suggestubThe following package(s) were not found, and no possible matches were found in the package db: {0}u, usuggestu/Package '{0}' not found (possible matches: {1})iuu. ulatestupkg.latest_versiontrefreshii����ulowpkg.bin_pkg_infouUnable to cache {0}: {1}u
cp.cache_fileufile not foundu{0} does not exist on minionu Failed to parse metadata for {0}uversionu%pkg_resource.check_extra_requirementsupkg_resource.version_cleanu
pkg.verifytignore_typestverify_optionsu
allow_updatesR*R0cs@s!|]\}}|dkVqdS(u==N((RvR RU((s3/usr/lib/python2.7/site-packages/salt/states/pkg.pys	<genexpr>sueCurrent version (%s) did not match desired version specification (%s), adding to installation targetsu u/All specified packages are already installed{0}u and are at the desired versionuwarningsN(/R.tallR=tlisttanytnextRjR+RRR;t
is_windowsR:RR>RRStpopR	RKRGRRLRRkRlRmR
RPtitemsR6RMR$RNROR,RQtupdatetostpathtexistsRR)RnRot
setdefaulttextend(6RTRURVtsourcesRWt
pkg_verifyRHR*t	reinstallRxRXt
was_refreshedt
altered_filesRyRztresolve_capabilitiesRYtcur_provRbREt
to_unpurgetpkginfoR[RqRrRsR\R]t
not_installedR^R_RIR`RFtytwants_latesttresolved_latesttkeyRatto_reinstalltwarningst
failed_verifytpackage_nameR5terrtcached_pathtsource_infoR!t
verify_resulttversion_fulfilledR0R1Rctret((s3/usr/lib/python2.7/site-packages/salt/states/pkg.pyt_find_install_targets�s�
	
		
	

#
$	




@
 
 4
		

"






	


	


	

c
C@sHg}g}|st�}nx|j�D]\}}d|k}tddkr�|r�gtj|�D]"\}	}
|
d|kri|	^qi}n�tddkr�|r�|j||j|jd�d��}n�tddkr|j|jd�d	�}nptd
dkr3|j|jd�d	�}nA|j|�}|rt||krt|j|j|�d	�}n|s�|j|�q+n{|d
kr�|j|�q+n\td|�s�|j|�q+n9|j	d�r|d	j
|d �r|j|�q+nt||d|�r-|j|�q+|j|�q+W||fS(ug
    Determine whether or not the installed packages match what was requested in
    the SLS file.
    u/uosuFreeBSDuoriginuMacOSi����uOpenBSDu%iu	os_familyuDebianu=ulatestupkg_resource.version_cleanu*R*(R>R�RjR
RPR:R#R$Rtendswitht
startswithR6(REtnew_pkgsR*tnew_capstoktfailedRIRt
has_originRrRsR\((s3/usr/lib/python2.7/site-packages/salt/states/pkg.pyt_verify_installIsB;+


&
cC@sT||s||jd�r'd}nd}dj||||sIdn||�S(u�
    Helper function that retrieves and nicely formats the desired pkg (and
    version if specified) so that helpful information can be printed in the
    comment for the state.
    u<u>u=uu	{0}{1}{2}(u<u>u=(R�RK(RTRER ((s3/usr/lib/python2.7/site-packages/salt/states/pkg.pyt_get_desired_pkgxs
	cK@s�dtkriSiid6gd6}tdd|t|j��|�}x]|D]U}||dtkrP||dr�||d|d|<q�|dj|�qPqPW|S(u>
    Perform platform-specific checks on desired packages
    upkg.check_dbusuggestu
no_suggesttfromrepoufoundusuggestions(RR|RRR.R$(RER�RXR�R�RI((s3/usr/lib/python2.7/site-packages/salt/states/pkg.pyRM�s

cC@s"tt_tj|�j�}|S(u-
    Serialize obj and format for output
    (t__opts__RtoutputRQ(tobjR�((s3/usr/lib/python2.7/site-packages/salt/states/pkg.pyt_nested_output�s	cK@s@|sdtkr||fStd|d||�}|tfS(u�
    Resolve capabilities in ``pkgs`` and exchange them with real package
    names, when the result is distinct.
    This feature can be turned on while setting the paramter
    ``resolve_capabilities`` to True.

    Return the input dictionary with replaced capability names and as
    second return value a bool which say if a refresh need to be run.

    In case of ``resolve_capabilities`` is False (disabled) or not
    supported by the implementation the input is returned unchanged.
    upkg.resolve_capabilitiesRx(RR.(RVRxRXR�((s3/usr/lib/python2.7/site-packages/salt/states/pkg.pyt_resolve_capabilities�s

c6!K@s�t|t�ot|�dkrDi|d6id6td6dd6Sn|oZt||f�r�|r|i||6g}t}n	|g}nt|d<tjj	j
t|�}|r�t|d||�\}}nt|	t�r�|	tk}	n|	p�t|	t�od	t
kr1i|d6id6td6d
d6Snt|tj�oM|tk	rbtj|�}n||d<t||||d|d
|d|	d|
d|d|d||�}y.|\}}}}}}}|r�t}nWnPtk
r.dt
kod|kr'y9|drdnd}t
|d|d|d|�}WnBttfk
r�}i|d6id6td6tj|�d6SnXd|ko�|dr�i|d6id6td6dj|d�d6Sn[g|D]}||dr�||^q�}g|D]-}||do||dr(||^q�}g|D]}||drT||^q5}xO|D]G}|dcdj|d�7<|d|d<|d|d|d<qaWx9|D]1}|dcdj|d�7<|d|d<q�Wx9|D]1}|dcdj|d�7<|d|d<q�Wn|SnX|o>dt
kr�i|d6id6td6dd6}|r�|jdg�j|�n|Sn|r
gtj|�D]!\}} t|| fg�^q�}|jgtj|�D]!\}} t|| fg�^q��n�|r�|}!g|!D]0}ttt|j����|krM|^q}|jg|!D]0}ttt|j����|kr�|^q`�ng}"tdr_|r|r�dj|�}#n+djg|D]}t||�^q��}#|"j dj|#��n|r4|"j d jdj|���n|r|r�g}$x:|D]2}%|ri|$j |%�n|$j t|%|��qMWd!}&|&dj|$�7}&|"j |&�n\xY|D]Q}%|r�|%}'nt|%|�}'|"j d"j|'��|"j t!||%��q�Wni|d6id6td6d#j|"�d6}|rX|jdg�j|�n|Sniid$6}(t}t}t}|p�|r�y\t
d%dtd|d&|d|d'|d|d|dt"|�d|
d(|
d||�})Wn�tk
r�}i|d6td6}|j#r>|j#j$di�|d<|j%|d<ni|d<d)j|�|d<|r}|jdg�j|�n|SnX|r�t}nt|)t�r�|(d$j&|)�n(t|)tj�r�|"j |)�i})nndt
ko�d|kr�
y3|dr
	dnd}t
|d|d|�}Wn�ttfk
r�	}|"j tj|��i|d6|(d6td6d#j|"�d6}|r�	|jdg�j|�n|SnXd|ko�	|dr
i|d6id6td6dj|d�d6}|r
|jdg�j|�n|Sn�g|D]}||drD
||^q&
}g|D]-}||doq
||dr~
||^qQ
}g|D]}||dr�
||^q�
}n|r�
t
d|�|(d*<n|rXg|(d$D]}||kr�
|^q�
}*g|D]$}||ko!||kr*|^q}+g|D]}||*krO|^q7},nt'd+d,krut|d-<nt
d.d/t|�}-|j$d0t�o�d1t
kr�t
d1|�}.ni}.t(||-d|d2|.�\}/},g|/D]}||kr|^q�}*g|/D]$}||ko*||kr3|^q}+g|,D]}||krX|^q@},|(j$d*�r{|(d$}(n|*rD
|r�dj|*�}#n+djg|*D]}t||�^q��}#t|#�d3kr�|"j d4j|#��nR|"j d5jt|*�t|*�d6kr
d7nd8t|*�d6kr7
d9nd:��n|rnx|D]}|d}0|0|(kr-|"j |d�t|(|0d;�dkr�
|(|0d;cd#7<n|(|0d;cd<j|dd;�7<t|(|0d=�dkr|(|0d=cd#7<n|(|0d=cd<j|dd=�7<n:|"j |d�i|(|0<d<j|dd;�|(|0d;<qQ
Wn|+r7|r�dj|+�}#n+djg|+D]}t||�^q��}#t|+�d3kr�|"j d>j|#��nR|"j d?jt|+�t|+�d6krd7nd8t|+�d6kr*d9nd:��n|rbx|D]}|"j |d�qDWnt}|,r�|r�dj|,�}#n+djg|,D]}t||�^q��}#|"j)dd@j|#��t}n|rx|D]}|"j |d�q�Wt}nt|	t�o&tdA�|	D��rBtdB�|	D��}1ng}1t|	t�ojtdC�|	D��r�tdD�|	D��}2ng}2g}*g},x�|D]�}%|r�|%|)kr�|*j |%�n
|,j |%�nR|	r)t
d	|%dE|1dF|2�}3|3r|,j |%�|3||%<n
|*j |%�nq�W|*r�x�|*D]}}4|rO|4}'nt|4|�}'dGj|'�}&|4|kr�|&dH7}&|"j |&�|"j t!||4��n
|"j |&�q:Wn|,rUx�|,D]}}5|r�|5}'nt|5|�}'dIj|'�}&|5|kr;|&dJ7}&|"j |&�|"j t!||5��n
|"j |&�q�Wt}ni|d6|(d6|d6d#j|"�d6}|r�|jdg�j|�n|S(Ku�Q
    Ensure that the package is installed, and that it is the correct version
    (if specified).

    :param str name:
        The name of the package to be installed. This parameter is ignored if
        either "pkgs" or "sources" is used. Additionally, please note that this
        option can only be used to install packages from a software repository.
        To install a package file manually, use the "sources" option detailed
        below.

    :param str version:
        Install a specific version of a package. This option is ignored if
        "sources" is used. Currently, this option is supported
        for the following pkg providers: :mod:`apt <salt.modules.aptpkg>`,
        :mod:`ebuild <salt.modules.ebuild>`,
        :mod:`pacman <salt.modules.pacman>`,
        :mod:`pkgin <salt.modules.pkgin>`,
        :mod:`win_pkg <salt.modules.win_pkg>`,
        :mod:`yumpkg <salt.modules.yumpkg>`, and
        :mod:`zypper <salt.modules.zypper>`. The version number includes the
        release designation where applicable, to allow Salt to target a
        specific release of a given version. When in doubt, using the
        ``pkg.latest_version`` function for an uninstalled package will tell
        you the version available.

        .. code-block:: bash

            # salt myminion pkg.latest_version vim-enhanced
            myminion:
                2:7.4.160-1.el7

        .. important::
            As of version 2015.8.7, for distros which use yum/dnf, packages
            which have a version with a nonzero epoch (that is, versions which
            start with a number followed by a colon like in the
            ``pkg.latest_version`` output above) must have the epoch included
            when specifying the version number. For example:

            .. code-block:: yaml

                vim-enhanced:
                  pkg.installed:
                    - version: 2:7.4.160-1.el7

            In version 2015.8.9, an **ignore_epoch** argument has been added to
            :py:mod:`pkg.installed <salt.states.pkg.installed>`,
            :py:mod:`pkg.removed <salt.states.pkg.removed>`, and
            :py:mod:`pkg.purged <salt.states.pkg.purged>` states, which
            causes the epoch to be disregarded when the state checks to see if
            the desired version was installed.

        Also, while this function is not yet implemented for all pkg frontends,
        :mod:`pkg.list_repo_pkgs <salt.modules.yumpkg.list_repo_pkgs>` will
        show all versions available in the various repositories for a given
        package, irrespective of whether or not it is installed.

        .. code-block:: bash

            # salt myminion pkg.list_repo_pkgs bash
            myminion:
            ----------
                bash:
                    - 4.2.46-21.el7_3
                    - 4.2.46-20.el7_2

        This function was first added for :mod:`pkg.list_repo_pkgs
        <salt.modules.yumpkg.list_repo_pkgs>` in 2014.1.0, and was expanded to
        :py:func:`Debian/Ubuntu <salt.modules.aptpkg.list_repo_pkgs>` and
        :py:func:`Arch Linux <salt.modules.pacman.list_repo_pkgs>`-based
        distros in the 2017.7.0 release.

        The version strings returned by either of these functions can be used
        as version specifiers in pkg states.

        You can install a specific version when using the ``pkgs`` argument by
        including the version after the package:

        .. code-block:: yaml

            common_packages:
              pkg.installed:
                - pkgs:
                  - unzip
                  - dos2unix
                  - salt-minion: 2015.8.5-1.el6

        If the version given is the string ``latest``, the latest available
        package version will be installed à la ``pkg.latest``.

        **WILDCARD VERSIONS**

        As of the 2017.7.0 release, this state now supports wildcards in
        package versions for SUSE SLES/Leap/Tumbleweed, Debian/Ubuntu,
        RHEL/CentOS, Arch Linux, and their derivatives. Using wildcards can be
        useful for packages where the release name is built into the version in
        some way, such as for RHEL/CentOS which typically has version numbers
        like ``1.2.34-5.el7``. An example of the usage for this would be:

        .. code-block:: yaml

            mypkg:
              pkg.installed:
                - version: '1.2.34*'

        Keep in mind that using wildcard versions will result in a slower state
        run since Salt must gather the available versions of the specified
        packages and figure out which of them match the specified wildcard
        expression.

    :param bool refresh:
        This parameter controls whether or not the package repo database is
        updated prior to installing the requested package(s).

        If ``True``, the package database will be refreshed (``apt-get
        update`` or equivalent, depending on platform) before installing.

        If ``False``, the package database will *not* be refreshed before
        installing.

        If unset, then Salt treats package database refreshes differently
        depending on whether or not a ``pkg`` state has been executed already
        during the current Salt run. Once a refresh has been performed in a
        ``pkg`` state, for the remainder of that Salt run no other refreshes
        will be performed for ``pkg`` states which do not explicitly set
        ``refresh`` to ``True``. This prevents needless additional refreshes
        from slowing down the Salt run.

    :param str cache_valid_time:

        .. versionadded:: 2016.11.0

        This parameter sets the value in seconds after which the cache is
        marked as invalid, and a cache update is necessary. This overwrites
        the ``refresh`` parameter's default behavior.

        Example:

        .. code-block:: yaml

            httpd:
              pkg.installed:
                - fromrepo: mycustomrepo
                - skip_verify: True
                - skip_suggestions: True
                - version: 2.0.6~ubuntu3
                - refresh: True
                - cache_valid_time: 300
                - allow_updates: True
                - hold: False

        In this case, a refresh will not take place for 5 minutes since the last
        ``apt-get update`` was executed on the system.

        .. note::

            This parameter is available only on Debian based distributions and
            has no effect on the rest.

    :param str fromrepo:
        Specify a repository from which to install

        .. note::

            Distros which use APT (Debian, Ubuntu, etc.) do not have a concept
            of repositories, in the same way as YUM-based distros do. When a
            source is added, it is assigned to a given release. Consider the
            following source configuration:

            .. code-block:: text

                deb http://ppa.launchpad.net/saltstack/salt/ubuntu precise main

            The packages provided by this source would be made available via
            the ``precise`` release, therefore ``fromrepo`` would need to be
            set to ``precise`` for Salt to install the package from this
            source.

            Having multiple sources in the same release may result in the
            default install candidate being newer than what is desired. If this
            is the case, the desired version must be specified using the
            ``version`` parameter.

            If the ``pkgs`` parameter is being used to install multiple
            packages in the same state, then instead of using ``version``,
            use the method of version specification described in the **Multiple
            Package Installation Options** section below.

            Running the shell command ``apt-cache policy pkgname`` on a minion
            can help elucidate the APT configuration and aid in properly
            configuring states:

            .. code-block:: bash

                root@saltmaster:~# salt ubuntu01 cmd.run 'apt-cache policy ffmpeg'
                ubuntu01:
                    ffmpeg:
                    Installed: (none)
                    Candidate: 7:0.10.11-1~precise1
                    Version table:
                        7:0.10.11-1~precise1 0
                            500 http://ppa.launchpad.net/jon-severinsson/ffmpeg/ubuntu/ precise/main amd64 Packages
                        4:0.8.10-0ubuntu0.12.04.1 0
                            500 http://us.archive.ubuntu.com/ubuntu/ precise-updates/main amd64 Packages
                            500 http://security.ubuntu.com/ubuntu/ precise-security/main amd64 Packages
                        4:0.8.1-0ubuntu1 0
                            500 http://us.archive.ubuntu.com/ubuntu/ precise/main amd64 Packages

            The release is located directly after the source's URL. The actual
            release name is the part before the slash, so to install version
            **4:0.8.10-0ubuntu0.12.04.1** either ``precise-updates`` or
            ``precise-security`` could be used for the ``fromrepo`` value.

    :param bool skip_verify:
        Skip the GPG verification check for the package to be installed

    :param bool skip_suggestions:
        Force strict package naming. Disables lookup of package alternatives.

        .. versionadded:: 2014.1.1

    :param bool resolve_capabilities:
        Turn on resolving capabilities. This allow one to name "provides" or alias names for packages.

        .. versionadded:: 2018.3.0

    :param bool allow_updates:
        Allow the package to be updated outside Salt's control (e.g. auto
        updates on Windows). This means a package on the Minion can have a
        newer version than the latest available in the repository without
        enforcing a re-installation of the package.

        .. versionadded:: 2014.7.0

        Example:

        .. code-block:: yaml

            httpd:
              pkg.installed:
                - fromrepo: mycustomrepo
                - skip_verify: True
                - skip_suggestions: True
                - version: 2.0.6~ubuntu3
                - refresh: True
                - allow_updates: True
                - hold: False

    :param bool pkg_verify:

        .. versionadded:: 2014.7.0

        For requested packages that are already installed and would not be
        targeted for upgrade or downgrade, use pkg.verify to determine if any
        of the files installed by the package have been altered. If files have
        been altered, the reinstall option of pkg.install is used to force a
        reinstall. Types to ignore can be passed to pkg.verify. Additionally,
        ``verify_options`` can be used to modify further the behavior of
        pkg.verify. See examples below.  Currently, this option is supported
        for the following pkg providers: :mod:`yumpkg <salt.modules.yumpkg>`.

        Examples:

        .. code-block:: yaml

            httpd:
              pkg.installed:
                - version: 2.2.15-30.el6.centos
                - pkg_verify: True

        .. code-block:: yaml

            mypkgs:
              pkg.installed:
                - pkgs:
                  - foo
                  - bar: 1.2.3-4
                  - baz
                - pkg_verify:
                  - ignore_types:
                    - config
                    - doc

        .. code-block:: yaml

            mypkgs:
              pkg.installed:
                - pkgs:
                  - foo
                  - bar: 1.2.3-4
                  - baz
                - pkg_verify:
                  - ignore_types:
                    - config
                    - doc
                  - verify_options:
                    - nodeps
                    - nofiledigest

    :param list ignore_types:
        List of types to ignore when verifying the package

        .. versionadded:: 2014.7.0

    :param list verify_options:
        List of additional options to pass when verifying the package. These
        options will be added to the ``rpm -V`` command, prepended with ``--``
        (for example, when ``nodeps`` is passed in this option, ``rpm -V`` will
        be run with ``--nodeps``).

        .. versionadded:: 2016.11.0

    :param bool normalize:
        Normalize the package name by removing the architecture, if the
        architecture of the package is different from the architecture of the
        operating system. The ability to disable this behavior is useful for
        poorly-created packages which include the architecture as an actual
        part of the name, such as kernel modules which match a specific kernel
        version.

        .. versionadded:: 2014.7.0

        Example:

        .. code-block:: yaml

            gpfs.gplbin-2.6.32-279.31.1.el6.x86_64:
              pkg.installed:
                - normalize: False

    :param bool ignore_epoch:
        When a package version contains an non-zero epoch (e.g.
        ``1:3.14.159-2.el7``, and a specific version of a package is desired,
        set this option to ``True`` to ignore the epoch when comparing
        versions. This allows for the following SLS to be used:

        .. code-block:: yaml

            # Actual vim-enhanced version: 2:7.4.160-1.el7
            vim-enhanced:
              pkg.installed:
                - version: 7.4.160-1.el7
                - ignore_epoch: True

        Without this option set to ``True`` in the above example, the package
        would be installed, but the state would report as failed because the
        actual installed version would be ``2:7.4.160-1.el7``. Alternatively,
        this option can be left as ``False`` and the full version string (with
        epoch) can be specified in the SLS file:

        .. code-block:: yaml

            vim-enhanced:
              pkg.installed:
                - version: 2:7.4.160-1.el7

        .. versionadded:: 2015.8.9

    |

    **MULTIPLE PACKAGE INSTALLATION OPTIONS: (not supported in pkgng)**

    :param list pkgs:
        A list of packages to install from a software repository. All packages
        listed under ``pkgs`` will be installed via a single command.

        .. code-block:: yaml

            mypkgs:
              pkg.installed:
                - pkgs:
                  - foo
                  - bar
                  - baz
                - hold: True

        ``NOTE:`` For :mod:`apt <salt.modules.aptpkg>`,
        :mod:`ebuild <salt.modules.ebuild>`,
        :mod:`pacman <salt.modules.pacman>`,
        :mod:`winrepo <salt.modules.win_pkg>`,
        :mod:`yumpkg <salt.modules.yumpkg>`, and
        :mod:`zypper <salt.modules.zypper>`,
        version numbers can be specified
        in the ``pkgs`` argument. For example:

        .. code-block:: yaml

            mypkgs:
              pkg.installed:
                - pkgs:
                  - foo
                  - bar: 1.2.3-4
                  - baz

        Additionally, :mod:`ebuild <salt.modules.ebuild>`, :mod:`pacman
        <salt.modules.pacman>`, :mod:`zypper <salt.modules.zypper>`,
        :mod:`yum/dnf <salt.modules.yumpkg>`, and :mod:`apt
        <salt.modules.aptpkg>` support the ``<``, ``<=``, ``>=``, and ``>``
        operators for more control over what versions will be installed. For
        example:

        .. code-block:: yaml

            mypkgs:
              pkg.installed:
                - pkgs:
                  - foo
                  - bar: '>=1.2.3-4'
                  - baz

        ``NOTE:`` When using comparison operators, the expression must be enclosed
        in quotes to avoid a YAML render error.

        With :mod:`ebuild <salt.modules.ebuild>` is also possible to specify a
        use flag list and/or if the given packages should be in
        package.accept_keywords file and/or the overlay from which you want the
        package to be installed. For example:

        .. code-block:: yaml

            mypkgs:
              pkg.installed:
                - pkgs:
                  - foo: '~'
                  - bar: '~>=1.2:slot::overlay[use,-otheruse]'
                  - baz

    :param list sources:
        A list of packages to install, along with the source URI or local path
        from which to install each package. In the example below, ``foo``,
        ``bar``, ``baz``, etc. refer to the name of the package, as it would
        appear in the output of the ``pkg.version`` or ``pkg.list_pkgs`` salt
        CLI commands.

        .. code-block:: yaml

            mypkgs:
              pkg.installed:
                - sources:
                  - foo: salt://rpms/foo.rpm
                  - bar: http://somesite.org/bar.rpm
                  - baz: ftp://someothersite.org/baz.rpm
                  - qux: /minion/path/to/qux.rpm

    **PLATFORM-SPECIFIC ARGUMENTS**

    These are specific to each OS. If it does not apply to the execution
    module for your OS, it is ignored.

    :param bool hold:
        Force the package to be held at the current installed version.
        Currently works with YUM/DNF & APT based systems.

        .. versionadded:: 2014.7.0

    :param bool update_holds:
        If ``True``, and this function would update the package version, any
        packages which are being held will be temporarily unheld so that they
        can be updated. Otherwise, if this function attempts to update a held
        package, the held package(s) will be skipped and the state will fail.
        By default, this parameter is set to ``False``.

        Currently works with YUM/DNF & APT based systems.

        .. versionadded:: 2016.11.0

    :param list names:
        A list of packages to install from a software repository. Each package
        will be installed individually by the package manager.

        .. warning::

            Unlike ``pkgs``, the ``names`` parameter cannot specify a version.
            In addition, it makes a separate call to the package management
            frontend to install each package, whereas ``pkgs`` makes just a
            single call. It is therefore recommended to use ``pkgs`` instead of
            ``names`` to install multiple packages, both for the additional
            features and the performance improvement that it brings.

    :param bool install_recommends:
        Whether to install the packages marked as recommended. Default is
        ``True``. Currently only works with APT-based systems.

        .. versionadded:: 2015.5.0

        .. code-block:: yaml

            httpd:
              pkg.installed:
                - install_recommends: False

    :param bool only_upgrade:
        Only upgrade the packages, if they are already installed. Default is
        ``False``. Currently only works with APT-based systems.

        .. versionadded:: 2015.5.0

        .. code-block:: yaml

            httpd:
              pkg.installed:
                - only_upgrade: True

        .. note::
            If this parameter is set to True and the package is not already
            installed, the state will fail.

    :param bool report_reboot_exit_codes:
       If the installer exits with a recognized exit code indicating that
       a reboot is required, the module function

           *win_system.set_reboot_required_witnessed*

       will be called, preserving the knowledge of this event
       for the remainder of the current boot session. For the time being,
       ``3010`` is the only recognized exit code,
       but this is subject to future refinement.
       The value of this param
       defaults to ``True``. This parameter has no effect
       on non-Windows systems.

       .. versionadded:: 2016.11.0

       .. code-block:: yaml

           ms vcpp installed:
             pkg.installed:
               - name: ms-vcpp
               - version: 10.0.40219
               - report_reboot_exit_codes: False

    :return:
        A dictionary containing the state of the software installation
    :rtype dict:

    .. note::

        The ``pkg.installed`` state supports the usage of ``reload_modules``.
        This functionality allows you to force Salt to reload all modules. In
        many cases, Salt is clever enough to transparently reload the modules.
        For example, if you install a package, Salt reloads modules because some
        other module or state might require the package which was installed.
        However, there are some edge cases where this may not be the case, which
        is what ``reload_modules`` is meant to resolve.

        You should only use ``reload_modules`` if your ``pkg.installed`` does some
        sort of installation where if you do not reload the modules future items
        in your state which rely on the software being installed will fail. Please
        see the :ref:`Reloading Modules <reloading-modules>` documentation for more
        information.

    iunameuchangesuresultuNo packages to install provideducommentusaltenvRxu
pkg.verifyupkg.verify not implementedu
allow_updatesR�RWR�RHR*R�upkg.holduholdu
pkg.unholdRTRVR�u@An error was encountered while holding/unholding package(s): {0}u.
{0}ulowpkg.unpurgeulowpkg.unpurge not implementeduwarningsutestu, u6The following packages would be installed/updated: {0}u_The following packages would have their selection status changed from 'purge' to 'install': {0}u-The following packages would be reinstalled: uQPackage '{0}' would be reinstalled because the following files have been altered:u
u	installedupkg.installRUtskip_verifytupdate_holdsu9An error was encountered while installing package(s): {0}u
purge_desireduosuFreeBSDuwith_originu
pkg.list_pkgsRiuresolve_capabilitiesupkg.list_providesR�iu2The following packages were installed/updated: {0}u.{0} targeted package{1} {2} installed/updated.iusuuwereuwasunewu{0}uoldu2The following packages were already installed: {0}u-{0} targeted package{1} {2} already installedu4The following packages failed to install/update: {0}cs@s?|]5}t|t�rd|kr|jd�dk	VqdS(uignore_typesN(R=RuR:RL(RvRF((s3/usr/lib/python2.7/site-packages/salt/states/pkg.pys	<genexpr>Uscs@s*|] }d|kr|jd�VqdS(uignore_typesN(R:(RvRF((s3/usr/lib/python2.7/site-packages/salt/states/pkg.pys	<genexpr>Yscs@s?|]5}t|t�rd|kr|jd�dk	VqdS(uverify_optionsN(R=RuR:RL(RvRF((s3/usr/lib/python2.7/site-packages/salt/states/pkg.pys	<genexpr>ascs@s*|] }d|kr|jd�VqdS(uverify_optionsN(R:(RvRF((s3/usr/lib/python2.7/site-packages/salt/states/pkg.pys	<genexpr>esRyRzuPackage {0} was reinstalled.u% The following files were remediated:u-Reinstall was not successful for package {0}.u- The following files could not be remediated:(*R=R|R,R+R}RLt__env__RRRt
check_refreshR�R�RR.R
tstring_typest	text_typeR�t
ValueErrorRRRKR�R�RPR>R~titerRRRNR�R$R�RktinfoR:tstrerror_without_changesR�RjR�tinsert(6RTRURxR�R�RWRVR�R0R�RHR*R�R�RXR&RERaR�R�R�R�R�tactionthold_retRbRFt
modified_holdtnot_modified_holdtfailed_holdtiR�R�t
oldsourcestcommenttsummarytreinstall_targetst
reinstall_pkgRctpkgstrtchangestpkg_rettmodifiedtnot_modifiedR�R�R�R�tchange_nameRyRzR�tmodified_pkgt
failed_pkg((s3/usr/lib/python2.7/site-packages/salt/states/pkg.pyt	installed�s���:!
	


	












7A
04
	"


	



	

	






")
(
%
%
	"
	%

%(
&	"
	%
	"
	
		
		
	

	


	


		

	
cK@si|d6id6dd6dd6}dtkrFt|d<d|d<|St|t�rt|�dkrt|d<d	|d<|S|r�|r�|r�i||6g}d}q�|g}nd
|kr�|d
=nt||�\}}t|||d|d||�}t|t	�r"d|kr"|St|t	�sRt|d<d
j
|�|d<|Stdr�dj|�}	dj
|	�|d<|SyStdd|d|d|dtd|d||�}
t|d<|dj
|
�Wnwtk
rN}i|d6td6}|jr-|jjdi�|d<|j|d<ni|d<dj
|�|d<|SXtd�}t||d|�\}
}|r�djg|D]}t||�^q��}	t|d<dj
|	�|d<n|dr|drt|d<dj
dj|��|d<n|S(u�
    .. versionadded:: 2017.7.0

    Ensure that the package is downloaded, and that it is the correct version
    (if specified).

    Currently supported for the following pkg providers:
    :mod:`yumpkg <salt.modules.yumpkg>` and :mod:`zypper <salt.modules.zypper>`

    :param str name:
        The name of the package to be downloaded. This parameter is ignored if
        either "pkgs" is used. Additionally, please note that this option can
        only be used to download packages from a software repository.

    :param str version:
        Download a specific version of a package.

        .. important::
            As of version 2015.8.7, for distros which use yum/dnf, packages
            which have a version with a nonzero epoch (that is, versions which
            start with a number followed by a colon must have the epoch included
            when specifying the version number. For example:

            .. code-block:: yaml

                vim-enhanced:
                  pkg.downloaded:
                    - version: 2:7.4.160-1.el7

            An **ignore_epoch** argument has been added to which causes the
            epoch to be disregarded when the state checks to see if the desired
            version was installed.

            You can install a specific version when using the ``pkgs`` argument by
            including the version after the package:

            .. code-block:: yaml

                common_packages:
                  pkg.downloaded:
                    - pkgs:
                      - unzip
                      - dos2unix
                      - salt-minion: 2015.8.5-1.el6

    :param bool resolve_capabilities:
        Turn on resolving capabilities. This allow one to name "provides" or alias names for packages.

        .. versionadded:: 2018.3.0

    CLI Example:

    .. code-block:: yaml

        zsh:
          pkg.downloaded:
            - version: 5.0.5-4.63
            - fromrepo: "myrepository"
    unameuchangesuresultuucommentupkg.list_downloadedu:The pkg.downloaded state is not available on this platformiu No packages to download providedudownloadonlyR�R*u4An error was encountered while checking targets: {0}utestu, u/The following packages would be downloaded: {0}upkg.installRTRVRUtdownloadonlyu:An error was encountered while downloading package(s): {0}u.The following packages failed to download: {0}u$Packages are already downloaded: {0}N(RLRR.R=R|R,R+R�RdR>RKR�RNR�RR�R:R�R�R�(RTRURVR�R*RXR�t_refreshRaR�R�RbR�R�R�RF((s3/usr/lib/python2.7/site-packages/salt/states/pkg.pyt
downloaded�s�A



!


	
	



	
	


	"

c

K@si|d6id6dd6dd6}dtkrFt|d<d|d<|St|t�rt|�dkrt|d<d	|d<|St|||�}t|t�r�d|kr�|St|t�s�t|d<d
j	|�|d<|St
drdj|�}d
j	|�|d<|SyAtdd|d|d||�}t|d<|dj|�Wnwt
k
r�}i|d6td6}|jr�|jjdi�|d<|j|d<ni|d<dj	|�|d<|SX|dr|dr|r�dnd}	t|d<dj	|	�|d<n|S(u
    .. versionadded:: 2017.7.0

    Ensure that packages related to certain advisory ids are installed.

    Currently supported for the following pkg providers:
    :mod:`yumpkg <salt.modules.yumpkg>` and :mod:`zypper <salt.modules.zypper>`

    CLI Example:

    .. code-block:: yaml

        issue-foo-fixed:
          pkg.patch_installed:
            - advisory_ids:
              - SUSE-SLE-SERVER-12-SP2-2017-185
              - SUSE-SLE-SERVER-12-SP2-2017-150
              - SUSE-SLE-SERVER-12-SP2-2017-120
    unameuchangesuresultuucommentupkg.list_patchesu?The pkg.patch_installed state is not available on this platformiuNo advisory ids providedu4An error was encountered while checking targets: {0}utestu, u7The following advisory patches would be downloaded: {0}upkg.installRTReR�u:An error was encountered while downloading package(s): {0}u
downloadedu	installedu@Advisory patch is not needed or related packages are already {0}N(RLRR.R=R|R,R+RhR>RKR�RNR�RR�R:R�(
RTReR�RXR�RaR�R�Rbtstatus((s3/usr/lib/python2.7/site-packages/salt/states/pkg.pytpatch_installedGs^



!





	
	


cK@s^dtkr,i|d6td6id6dd6Sd|krB|d=ntd|d	|d
t|�S(u
    .. versionadded:: 2017.7.0

    Ensure that packages related to certain advisory ids are downloaded.

    Currently supported for the following pkg providers:
    :mod:`yumpkg <salt.modules.yumpkg>` and :mod:`zypper <salt.modules.zypper>`

    CLI Example:

    .. code-block:: yaml

        preparing-to-fix-issues:
          pkg.patch_downloaded:
            - advisory_ids:
              - SUSE-SLE-SERVER-12-SP2-2017-185
              - SUSE-SLE-SERVER-12-SP2-2017-150
              - SUSE-SLE-SERVER-12-SP2-2017-120
    upkg.list_patchesunameuresultuchangesu@The pkg.patch_downloaded state is not available on this platformucommentudownloadonlyRTReR�(RR.R�R+(RTReRX((s3/usr/lib/python2.7/site-packages/salt/states/pkg.pytpatch_downloaded�s

c
K@s�tjjjt|�}|jd�rGi|d6id6td6dd6S|r�tt|�j	��}|s�i|d6id6td6dd6SnJt
|t�r�t|�dkr�i|d6id6td6d	d6S|g}t
|d
<t|d||�\}}y#tdd
|d|||�}Wn9tk
r[}	i|d6id6td6dj|	�d6SXytd||�}
Wn3tk
r�}	i|d6id6td6|	jd6SXt
|
tj�r�i|
|d6}
nt
|tj�r�i||d6}ni}g}x�|D]�}
|j|
�s�|
j|
�sXdj|
�}tj|�|j|�q�|r�tjd�dkr�td|
�r�|
|
||
<q�q||
||
<qW|r�i|d6id6td6dj|�d6S|r|s�g}n%g|D]}||kr�|^q�}tdr�g}|jddjt|���|r�t|�}|dkr�|jddjgt|�D]}dj||
|�^q|��q�|jdj|��ni|d6id6d1d6dj|�d6Stjjj�r!g|D]}i|||6^q}nt|�}y2tddd1dtd
|d|d ||�}Wn9tk
r�}	i|d6id6td6d!j|	�d6SX|rg|D]I}|j|�s�||jd"�||kr�||d#kr�|^q�}g|D]}||kr�|^q�}g}|rVd$jdjt|���}|j|�n|r�d%jdjt|���}|j|�n|r�t|�dkr�d&jdjt|���}nd'jt|��}|j|�ni|d6|d6|rtntd6dj|�d6St|�dkrGd(jt|��}nZt|�d)krzd*jdjt|���}n'd+jttt|j	�����}|r�t|�dkr�|d,jdjt|���7}q�|d-jt|��7}ni|d6|d6td6|d6Sn�t|�dkrGd.jt|��}nFt|�d)krzd/jdjt|���}nd0j|d�}i|d6id6td6|d6Sd1S(2u,
    Ensure that the named package is installed and the latest available
    package. If the package can be updated, this state function will update
    the package. Generally it is better for the
    :mod:`installed <salt.states.pkg.installed>` function to be
    used, as :mod:`latest <salt.states.pkg.latest>` will update the package
    whenever a new package is available.

    name
        The name of the package to maintain at the latest available version.
        This parameter is ignored if "pkgs" is used.

    fromrepo
        Specify a repository from which to install

    skip_verify
        Skip the GPG verification check for the package to be installed

    refresh
        This parameter controls whether or not the package repo database is
        updated prior to checking for the latest available version of the
        requested packages.

        If ``True``, the package database will be refreshed (``apt-get update``
        or equivalent, depending on platform) before checking for the latest
        available version of the requested packages.

        If ``False``, the package database will *not* be refreshed before
        checking.

        If unset, then Salt treats package database refreshes differently
        depending on whether or not a ``pkg`` state has been executed already
        during the current Salt run. Once a refresh has been performed in a
        ``pkg`` state, for the remainder of that Salt run no other refreshes
        will be performed for ``pkg`` states which do not explicitly set
        ``refresh`` to ``True``. This prevents needless additional refreshes
        from slowing down the Salt run.

    :param str cache_valid_time:

        .. versionadded:: 2016.11.0

        This parameter sets the value in seconds after which the cache is
        marked as invalid, and a cache update is necessary. This overwrites
        the ``refresh`` parameter's default behavior.

        Example:

        .. code-block:: yaml

            httpd:
              pkg.latest:
                - refresh: True
                - cache_valid_time: 300

        In this case, a refresh will not take place for 5 minutes since the last
        ``apt-get update`` was executed on the system.

        .. note::

            This parameter is available only on Debian based distributions and
            has no effect on the rest.

    :param bool resolve_capabilities:
        Turn on resolving capabilities. This allow one to name "provides" or alias names for packages.

        .. versionadded:: 2018.3.0

    Multiple Package Installation Options:

    (Not yet supported for: FreeBSD, OpenBSD, MacOS, and Solaris pkgutil)

    pkgs
        A list of packages to maintain at the latest available version.

    .. code-block:: yaml

        mypkgs:
          pkg.latest:
            - pkgs:
              - foo
              - bar
              - baz

    install_recommends
        Whether to install the packages marked as recommended. Default is
        ``True``. Currently only works with APT-based systems.

        .. versionadded:: 2015.5.0

    .. code-block:: yaml

        httpd:
          pkg.latest:
            - install_recommends: False

    only_upgrade
        Only upgrade the packages, if they are already installed. Default is
        ``False``. Currently only works with APT-based systems.

        .. versionadded:: 2015.5.0

    .. code-block:: yaml

        httpd:
          pkg.latest:
            - only_upgrade: True

    .. note::
        If this parameter is set to True and the package is not already
        installed, the state will fail.

   report_reboot_exit_codes
        If the installer exits with a recognized exit code indicating that
        a reboot is required, the module function

           *win_system.set_reboot_required_witnessed*

        will be called, preserving the knowledge of this event
        for the remainder of the current boot session. For the time being,
        ``3010`` is the only recognized exit code, but this
        is subject to future refinement. The value of this param
        defaults to ``True``. This parameter has no effect on
        non-Windows systems.

        .. versionadded:: 2016.11.0

        .. code-block:: yaml

           ms vcpp installed:
             pkg.latest:
               - name: ms-vcpp
               - report_reboot_exit_codes: False

    usourcesunameuchangesuresultu)The "sources" parameter is not supported.ucommentu5Invalidly formatted "pkgs" parameter. See minion log.iuNo packages to install providedusaltenvRxupkg.latest_versionR�uWAn error was encountered while checking the newest available version of package(s): {0}upkg.versionuNo information found for '{0}'.uosuGentoouportage_config.is_changed_usesu utestu4The following packages would be installed/upgraded: u, i
u/The following packages are already up-to-date: u	{0} ({1})u#{0} packages are already up-to-dateu
upkg.installRTR�RVu9An error was encountered while installing package(s): {0}unewulatestu,The following packages failed to update: {0}u@The following packages were successfully installed/upgraded: {0}u3The following packages were already up-to-date: {0}u%{0} packages were already up-to-date uB{0} targeted packages failed to update. See debug log for details.iuSThe following targeted packages failed to update. See debug log for details: ({0}).uPackage {0} failed to update.u4 The following packages were already up-to-date: {0}u${0} packages were already up-to-dateu All {0} packages are up-to-date.u"All packages are up-to-date ({0}).u!Package {0} is already up-to-dateN( RRRR�R�R:R.R|R	RRR=R,R+R�R�RRRKRSR
R�RnterrorR$RjRNRORLR;RR~R�(RTRxR�R�RVtwatch_flagsRXtdesired_pkgstavailRbtcurRaR^RRct
up_to_dateRFR_tup_to_date_countt
targeted_pkgsR�R�t
successfulR�((s3/usr/lib/python2.7/site-packages/salt/states/pkg.pytlatest�s>�

!	






	%
4

'


%
!		


uremovecK@s%|d#kr5i|d6id6td6dj|�d6Sy!td||d	|�d
}Wn9tk
r�}i|d6id6td6dj|�d6SXt||||d||�}	t|	t�r�d|	kr�|	St|	t�si|d6id6td6d
j|	�d6S|dkr^tddtdt|�}
|	j	g|D]}||
kr<|^q<�n|	j
�|	s�i|d6id6td6dj|dkr�dnd�d6Stdr�i|d6id6d$d6dj|dj
|	��d6Stdj|�|d|d||�}tddt|�}
g}x�|D]�}tdd%kr�||
krp||rp|j|�q�||
kr�|||
|kr�|j|d||�q�q3||
kr3|j|�q3q3W|dkr&tddtdt|�}|j	g|D]}||kr|^q�n|j
�|rki|d6|d6td6dj|dj
|��d6Sg}tg|D]}||	kr{|^q{�}|r�|jdjdj
|���|jd j|dj
|	���n|jd!j|��i|d6|d6td6d"j
|�d6S(&u-
    Common function for package removal
    uremoveupurgeunameuchangesuresultu-Invalid action '{0}'. This is probably a bug.ucommentupkg_resource.parse_targetsRHiu3An error was encountered while parsing targets: {0}R*u4An error was encountered while checking targets: {0}u
pkg.list_pkgsRitremovedu.None of the targeted packages are installed{0}u or partially installeduutestu)The following packages will be {0}d: {1}.u, upkg.{0}RVRUu	os_familyuSuseuRedHatu-u*The following packages failed to {0}: {1}.u.The following packages were not installed: {0}u&The following packages were {0}d: {1}.u All targeted packages were {0}d.u (uremoveupurgeN(uSuseuRedHat(R.RKRRRtR=R>R|R+R�tsortR�RLRNRjR$RO(R�RTRURVRHR*RXt
pkg_paramsRbRatold_removedRFR�tnewR�tnew_removedR_R�((s3/usr/lib/python2.7/site-packages/salt/states/pkg.pyt
_uninstall)
s�


	/



(
 	/

+
cK@s�t|d<y2tddd|d|d|d|d||�SWnwtk
r�}i|d	6td
6}|jr�|jjdi�|d<|j|d<ni|d<d
j|�|d<|SXdS(u�
    Verify that a package is not installed, calling ``pkg.remove`` if necessary
    to remove the package.

    name
        The name of the package to be removed.

    version
        The version of the package that should be removed. Don't do anything if
        the package is installed with an unmatching version.

        .. important::
            As of version 2015.8.7, for distros which use yum/dnf, packages
            which have a version with a nonzero epoch (that is, versions which
            start with a number followed by a colon like in the example above)
            must have the epoch included when specifying the version number.
            For example:

            .. code-block:: yaml

                vim-enhanced:
                  pkg.removed:
                    - version: 2:7.4.160-1.el7

            In version 2015.8.9, an **ignore_epoch** argument has been added to
            :py:mod:`pkg.installed <salt.states.pkg.installed>`,
            :py:mod:`pkg.removed <salt.states.pkg.removed>`, and
            :py:mod:`pkg.purged <salt.states.pkg.purged>` states, which
            causes the epoch to be disregarded when the state checks to see if
            the desired version was installed. If **ignore_epoch** was not set
            to ``True``, and instead of ``2:7.4.160-1.el7`` a version of
            ``7.4.160-1.el7`` were used, this state would report success since
            the actual installed version includes the epoch, and the specified
            version would not match.

    normalize : True
        Normalize the package name by removing the architecture, if the
        architecture of the package is different from the architecture of the
        operating system. The ability to disable this behavior is useful for
        poorly-created packages which include the architecture as an actual
        part of the name, such as kernel modules which match a specific kernel
        version.

        .. versionadded:: 2015.8.0

    ignore_epoch : False
        When a package version contains an non-zero epoch (e.g.
        ``1:3.14.159-2.el7``, and a specific version of a package is desired,
        set this option to ``True`` to ignore the epoch when comparing
        versions. This allows for the following SLS to be used:

        .. code-block:: yaml

            # Actual vim-enhanced version: 2:7.4.160-1.el7
            vim-enhanced:
              pkg.removed:
                - version: 7.4.160-1.el7
                - ignore_epoch: True

        Without this option set to ``True`` in the above example, the state
        would falsely report success since the actual installed version is
        ``2:7.4.160-1.el7``. Alternatively, this option can be left as
        ``False`` and the full version string (with epoch) can be specified in
        the SLS file:

        .. code-block:: yaml

            vim-enhanced:
              pkg.removed:
                - version: 2:7.4.160-1.el7

        .. versionadded:: 2015.8.9

    Multiple Package Options:

    pkgs
        A list of packages to remove. Must be passed as a python list. The
        ``name`` parameter will be ignored if this option is passed. It accepts
        version numbers as well.

        .. versionadded:: 0.16.0
    usaltenvR�uremoveRTRURVRHR*unameuresultuchangesucommentu7An error was encountered while removing package(s): {0}N(R�R�RR.R�R:R�RK(RTRURVRHR*RXRbR�((s3/usr/lib/python2.7/site-packages/salt/states/pkg.pyR��
sX
	

cK@s�t|d<y2tddd|d|d|d|d||�SWnwtk
r�}i|d	6td
6}|jr�|jjdi�|d<|j|d<ni|d<d
j|�|d<|SXdS(u�
    Verify that a package is not installed, calling ``pkg.purge`` if necessary
    to purge the package. All configuration files are also removed.

    name
        The name of the package to be purged.

    version
        The version of the package that should be removed. Don't do anything if
        the package is installed with an unmatching version.

        .. important::
            As of version 2015.8.7, for distros which use yum/dnf, packages
            which have a version with a nonzero epoch (that is, versions which
            start with a number followed by a colon like in the example above)
            must have the epoch included when specifying the version number.
            For example:

            .. code-block:: yaml

                vim-enhanced:
                  pkg.purged:
                    - version: 2:7.4.160-1.el7

            In version 2015.8.9, an **ignore_epoch** argument has been added to
            :py:mod:`pkg.installed <salt.states.pkg.installed>`,
            :py:mod:`pkg.removed <salt.states.pkg.removed>`, and
            :py:mod:`pkg.purged <salt.states.pkg.purged>` states, which
            causes the epoch to be disregarded when the state checks to see if
            the desired version was installed. If **ignore_epoch** was not set
            to ``True``, and instead of ``2:7.4.160-1.el7`` a version of
            ``7.4.160-1.el7`` were used, this state would report success since
            the actual installed version includes the epoch, and the specified
            version would not match.

    normalize : True
        Normalize the package name by removing the architecture, if the
        architecture of the package is different from the architecture of the
        operating system. The ability to disable this behavior is useful for
        poorly-created packages which include the architecture as an actual
        part of the name, such as kernel modules which match a specific kernel
        version.

        .. versionadded:: 2015.8.0

    ignore_epoch : False
        When a package version contains an non-zero epoch (e.g.
        ``1:3.14.159-2.el7``, and a specific version of a package is desired,
        set this option to ``True`` to ignore the epoch when comparing
        versions. This allows for the following SLS to be used:

        .. code-block:: yaml

            # Actual vim-enhanced version: 2:7.4.160-1.el7
            vim-enhanced:
              pkg.purged:
                - version: 7.4.160-1.el7
                - ignore_epoch: True

        Without this option set to ``True`` in the above example, the state
        would falsely report success since the actual installed version is
        ``2:7.4.160-1.el7``. Alternatively, this option can be left as
        ``False`` and the full version string (with epoch) can be specified in
        the SLS file:

        .. code-block:: yaml

            vim-enhanced:
              pkg.purged:
                - version: 2:7.4.160-1.el7

        .. versionadded:: 2015.8.9

    Multiple Package Options:

    pkgs
        A list of packages to purge. Must be passed as a python list. The
        ``name`` parameter will be ignored if this option is passed. It accepts
        version numbers as well.

    .. versionadded:: 0.16.0
    usaltenvR�upurgeRTRURVRHR*unameuresultuchangesucommentu6An error was encountered while purging package(s): {0}N(R�R�RR.R�R:R�RK(RTRURVRHR*RXRbR�((s3/usr/lib/python2.7/site-packages/salt/states/pkg.pytpurged�
sX
	

c
@s�i|d6id6td6dd6}dtkr<d|d<|Sd|krftd	d
krfd|d<|St|t�rFt�d||�\�}y�tdd||�}d
�tj|�D�}t�t�rg|D]}|�kr�|^q�}�fd�tj|�D�}nWqTt	k
rB}tj
|�|d<|SXnd|d<|S|srd|d<t|d<|Stdr�d|d<||d<d|d<|Sy$tdd|d�|�|d<Wnctk
r'}|jr|jjdi�|d<|j|d<ni|d<dj|�|d<|SXg}	t�t�rrgtj|�D]}||dkrM|^qM}	n|	r�djdj|	��|d<t|d<nd|d<t|d<|S(u�
    .. versionadded:: 2014.7.0
    .. versionchanged:: 2018.3.0

        Added support for the ``pkgin`` provider.

    Verify that the system is completely up to date.

    name
        The name has no functional value and is only used as a tracking
        reference

    refresh
        refresh the package database before checking for new upgrades

    pkgs
        list of packages to upgrade

    :param str cache_valid_time:
        This parameter sets the value in seconds after which cache marked as invalid,
        and cache update is necessary. This overwrite ``refresh`` parameter
        default behavior.

        In this case cache_valid_time is set, refresh will not take place for
        amount in seconds since last ``apt-get update`` executed on the system.

        .. note::

            This parameter available only on Debian based distributions, and
            have no effect on the rest.

    :param bool resolve_capabilities:
        Turn on resolving capabilities. This allow one to name "provides" or alias names for packages.

        .. versionadded:: 2018.3.0

    kwargs
        Any keyword arguments to pass through to ``pkg.upgrade``.

        .. versionadded:: 2015.5.0
    unameuchangesuresultuFailed to updateucommentupkg.list_upgradesu#State pkg.uptodate is not availableufromrepouosuGentoou2'fromrepo' argument not supported on this platformRxcS@s7i|]-\}}i|d6td|�d6|�qS(unewupkg.versionuold(R(RvRIR((s3/usr/lib/python2.7/site-packages/salt/states/pkg.pys
<dictcomp>�s	c@s+i|]!\}}|�kr||�qS(((RvRIR(RV(s3/usr/lib/python2.7/site-packages/salt/states/pkg.pys
<dictcomp>�s	u$refresh must be either True or FalseuSystem is already up-to-dateutestuSystem update will be performedupkg.upgradeRVu5An error was encountered while updating packages: {0}u.The following package(s) failed to update: {0}u, uUpgrade ran successfullyN(R.RRjR=RkR�R
RPR|t	ExceptionR�R+R�RLRR�R:R�RKtiterkeysRN(
RTRxRVRXR�tpackagestexpectedRRbtmissing((RVs3/usr/lib/python2.7/site-packages/salt/states/pkg.pytuptodateesh*



%&






$	

5


cK@s�i|d6id6td6dd6}dtkr<d|d<|S|dkrQg}nbt|t�snd|d<|SxBt|�D]4\}}t|tj�s{tj|�||<q{q{W|dkr�g}nbt|t�s�d	|d<|SxBt|�D]4\}}t|tj�s�tj|�||<q�q�Wytd|�}Wn*t	k
rj}d
j
||�|d<|SX|dd|dd
}	g|	D]}
|
|kr�|
^q�}|r�dj
dj|��|d<|S|dd
}|jg|dd
D]}
|
|kr�|
^q��|j|�|sFt
|d<dj
|�|d<|S|ddpm|ddpm|dd}
tdr�d|d<|
r�dj
|�|d<ndj
|�|d<|Sytdd||�|d<Wnzt	k
rQ}i|d6td6}|jr-|jjdi�|d<|j|d<n i|d<dj
||�|d<|SXg|D]}
|
td�krY|
^qY}|r�dj
dj|��|d<|St
|d<dj
||
r�dnd�|d<|S(u<
    .. versionadded:: 2015.8.0

    .. versionchanged:: 2016.11.0
        Added support in :mod:`pacman <salt.modules.pacman>`

    Ensure that an entire package group is installed. This state is currently
    only supported for the :mod:`yum <salt.modules.yumpkg>` and :mod:`pacman <salt.modules.pacman>`
    package managers.

    skip
        Packages that would normally be installed by the package group
        ("default" packages), which should not be installed.

        .. code-block:: yaml

            Load Balancer:
              pkg.group_installed:
                - skip:
                  - piranha

    include
        Packages which are included in a group, which would not normally be
        installed by a ``yum groupinstall`` ("optional" packages). Note that
        this will not enforce group membership; if you include packages which
        are not members of the specified groups, they will still be installed.

        .. code-block:: yaml

            Load Balancer:
              pkg.group_installed:
                - include:
                  - haproxy

        .. versionchanged:: 2016.3.0
            This option can no longer be passed as a comma-separated list, it
            must now be passed as a list (as shown in the above example).

    .. note::
        Because this is essentially a wrapper around :py:func:`pkg.install
        <salt.modules.yumpkg.install>`, any argument which can be passed to
        pkg.install may also be included here, and it will be passed on to the
        call to :py:func:`pkg.install <salt.modules.yumpkg.install>`.
    unameuchangesuresultuucommentupkg.group_diffu1pkg.group_install not available for this platformu skip must be formatted as a listu#include must be formatted as a listuDAn error was encountered while installing/updating group '{0}': {1}.u	mandatoryu	installedu
not installedu7The following mandatory packages cannot be skipped: {0}u, udefaultu Group '{0}' is already installeduoptionalutestu6Group '{0}' is partially installed and will be updateduGroup '{0}' will be installedupkg.installRVuCAn error was encountered while installing/updating group '{0}': {1}u
pkg.list_pkgsu-Failed to install the following packages: {0}uGroup '{0}' was {1}uupdatedN(R.RRLR=R|t	enumerateR
R�R�RRKRNR�R+R�R�R:R�(RTtskiptincludeRXR�tidxtitemtdiffR�t	mandatoryRFtinvalid_skipRatpartially_installedRbR�((s3/usr/lib/python2.7/site-packages/salt/states/pkg.pytgroup_installed�s�-


	
	
%



	
,
cC@s`t}dtkr%td|�}n|ddksE|ddkr\tjjjt�|StS(u�
    Set a flag to tell the install functions to refresh the package database.
    This ensures that the package database is refreshed only once during
    a state run significantly improving the speed of package management
    during a state run.

    It sets a flag for a number of reasons, primarily due to timeline logic.
    When originally setting up the mod_init for pkg a number of corner cases
    arose with different package managers and how they refresh package data.

    It also runs the "ex_mod_init" from the package manager module that is
    currently loaded. The "ex_mod_init" is expected to work as a normal
    "mod_init" function.

    .. seealso::
       :py:func:`salt.modules.ebuild.ex_mod_init`

    upkg.ex_mod_initufunu	installedulatest(R+RRRRt
write_rtagR�R.(tlowR�((s3/usr/lib/python2.7/site-packages/salt/states/pkg.pytmod_initgs c	C@sg}d}ddddg}|jd�|kr7|Sx�|D]�}td|�}||krfq>n|jd�dkr>d	|kr�q>n|jd�|jd�kr�q>n|jd
�|jd
�kr�q>nd|kr#|dkr�d}n|dkr�|j|d�t|d	<q�q�|dkr8d}n|dkr�d|krn|j|d�t|d	<q�d
|kr�|jdd�}|dk	r�|ji||d
6�n|j|d
�t|d	<q�q�q>q>W|dk	r|r||kr
||j|�q|||<n|S(u�
    The mod_aggregate function which looks up all packages in the available
    low chunks and merges them into a single pkgs ref in the present low data
    u	installedulatesturemovedupurgedufunu
state.gen_tagustateupkgu__agg__ufromrepousourcesupkgsunameuversionN(RLR:t	__utils__R�R+R�R$(	R�tchunkstrunningRVtpkg_typetagg_enabledtchunkttagRU((s3/usr/lib/python2.7/site-packages/salt/states/pkg.pyt
mod_aggregate�sT	
		

cK@sz|jdd�}itd6td6td6td6}||krQ||||�Si|d6id6dj|�d	6td
6S(u1
    Install/reinstall a package based on a watch requisite

    .. note::
        This state exists to support special handling of the ``watch``
        :ref:`requisite <requisites>`. It should not be called directly.

        Parameters for this function should be set by the state being triggered.
    usfunupurgedulatesturemovedu	installedunameuchangesu.pkg.{0} does not work with the watch requisiteucommenturesultN(R�RLR�R�R�R�RKR.(RTRXtsfuntmapfun((s3/usr/lib/python2.7/site-packages/salt/states/pkg.pyt	mod_watch�s



([t__doc__t
__future__RRRR?tloggingR�Rltsalt.utils.pkgRtsalt.utils.platformtsalt.utils.versionstsalt.outputRtsalt.utils.functoolsRt_namespaced_functiontsalt.utils.odictRRutsalt.exceptionsRRRtsalt.modules.pkg_resourceR	tsalt.extR
tglobalsRR;Rtsalt.ext.six.moves.urllib.parseRt	_urlparseRtcollectionstdatetimeterrnottimet	functoolsR
tsalt.modules.win_pkgRRRRRRRRRtmsgpacktImportErrortmsgpack_pureRt	getLoggert__name__RnRR"R)R.R6R-RGRLR+RdRhRtR�R�R�RMR�R�R�R�R�R�R�R�R�R�R�R�R�RR(((s3/usr/lib/python2.7/site-packages/salt/states/pkg.pyt<module>Js
			(	
u'M�M/				�����P$�lcgfn�		<

Zerion Mini Shell 1.0