%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/pkgutil.pyo

�
���^c@@s*dZddlmZmZmZddlZddlZddlZddl	Zddl
ZddlmZm
Z
ddlmZdZd�Zd�Zd	�Zed
�Zed�Zed�Zd
�Zd�Zejjjed�Zdeddd�Z ddd�Z!ddd�Z"dS(u
Pkgutil support for Solaris

.. important::
    If you feel that Salt should be using this module to manage packages on a
    minion, and it is using a different module (or gives an error similar to
    *'pkg.install' is not available*), see :ref:`here
    <module-provider-override>`.
i(tabsolute_importtprint_functiontunicode_literalsN(tCommandExecutionErrortMinionError(tsixupkgutilcC@stddkrtStdfS(u9
    Set the virtual pkg module if the os is Solaris
    u	os_familyuSolarisuQThe pkgutil execution module cannot be loaded: only available on Solaris systems.(t
__grains__t__virtualname__tFalse(((s8/usr/lib/python2.7/site-packages/salt/modules/pkgutil.pyt__virtual__scC@s'tjjjt�tdd�dkS(u�
    Updates the pkgutil repo database (pkgutil -U)

    CLI Example:

    .. code-block:: bash

        salt '*' pkgutil.refresh_db
    ucmd.retcodeu/opt/csw/bin/pkgutil -Ui(tsalttutilstpkgt
clear_rtagt__opts__t__salt__(((s8/usr/lib/python2.7/site-packages/salt/modules/pkgutil.pyt
refresh_db&scC@sed}dj|�}td|�}|rD|j�dj�}n|ra|dkrZdS|SndS(u�
    Check if there is an upgrade available for a certain package

    CLI Example:

    .. code-block:: bash

        salt '*' pkgutil.upgrade_available CSWpython
    u,/opt/csw/bin/pkgutil -c --parse --single {0}ucmd.run_stdoutiuSAMEuN(tNonetformatRtsplittstrip(tnametversion_numtcmdtout((s8/usr/lib/python2.7/site-packages/salt/modules/pkgutil.pytupgrade_available5s
	cK@s�tjjj|�rt�ni}tdd�j�}x[|D]S}|jd�}|ddkrmqBn|ddkr�qBn|d||d<qBW|S(	u�
    List all available package upgrades on this system

    CLI Example:

    .. code-block:: bash

        salt '*' pkgutil.list_upgrades
    ucmd.run_stdoutu/opt/csw/bin/pkgutil -A --parseu	iuSAMEu
not installedii(R
Rtdatatis_trueRRt
splitlinesR(trefreshtkwargstupgradestlinestlinetcomps((s8/usr/lib/python2.7/site-packages/salt/modules/pkgutil.pyt
list_upgradesMs


cC@sktjjj|�rt�nt�}d}td|�tjdd�t�}tjjj
||�S(u!
    Upgrade all of the packages to the latest available version.

    Returns a dict containing the changes::

        {'<package>': {'old': '<old-version>',
                       'new': '<new-version>'}}

    CLI Example:

    .. code-block:: bash

        salt '*' pkgutil.upgrade
    u/opt/csw/bin/pkgutil -yuucmd.run_allu
pkg.list_pkgsN(R
RRRRt	list_pkgsRt__context__tpopRt
compare_dicts(RtoldRtnew((s8/usr/lib/python2.7/site-packages/salt/modules/pkgutil.pytupgradefs
		c	K@sZtjjj|�}tjjj|jd��r7iSdtkry|rQtdStjtd�}td|�|Sni}d}td|�j	�}x�t
|�D]r\}}|ddkr�|j�dj�}n|ddkr�|j�dj�}td	|||�q�q�Wtd
|�tj|�td<|sVtd|�n|S(u�
    List the packages currently installed as a dict::

        {'<package_name>': '<version>'}

    CLI Example:

    .. code-block:: bash

        salt '*' pkg.list_pkgs
        salt '*' pkg.list_pkgs versions_as_list=True
    uremovedu
pkg.list_pkgsupkg_resource.stringifyu/usr/bin/pkginfo -xucmd.runiiiupkg_resource.add_pkgupkg_resource.sort_pkglist(
R
RRRtgetR%tcopytdeepcopyRRt	enumerateRR(	tversions_as_listRtretRR tindexR!RR((s8/usr/lib/python2.7/site-packages/salt/modules/pkgutil.pyR$�s.
cO@std||�S(u�
    Returns a version if the package is installed, else returns an empty string

    CLI Example:

    .. code-block:: bash

        salt '*' pkgutil.version CSWpython
    upkg_resource.version(R(tnamesR((s8/usr/lib/python2.7/site-packages/salt/modules/pkgutil.pytversion�s
c	O@srtjjj|jdt��}|s+dSi}x|D]}d||<q8W|r\t�nt�}djdj	|��}t
d|�jdd�j�}x�|D]�}y|j
�dd!\}}	Wntk
r�q�nX||kr�|j|d�}
|	j
d	�d
}|
s<tjjjd|
dd
d|�rL|	||<qLq�q�Wt|�dkrn||d
S|S(u�
    Return the latest version of the named package available for upgrade or
    installation. If more than one package name is specified, a dict of
    name/version pairs is returned.

    If the latest version of a given package is already installed, an empty
    string will be returned for that package.

    CLI Example:

    .. code-block:: bash

        salt '*' pkgutil.latest_version CSWpython
        salt '*' pkgutil.latest_version <package1> <package2> <package3> ...
    urefreshuu#/opt/csw/bin/pkgutil -a --parse {0}u ucmd.run_allustdoutiiu,itver1toperu<tver2(R
RRRR&tTrueRR$RtjoinRR+RRt
ValueErrortversionstcomparetlen(R2RRR0RtpkgsRtoutputR!tversion_revtcvertnver((s8/usr/lib/python2.7/site-packages/salt/modules/pkgutil.pytlatest_version�s4!

	"

	uavailable_versionc
K@s_|rt�nytd|||�d}Wntk
rO}t|��nX|d	ksnt|�dkrriS|d	kr�|r�t|�dkr�i||6}ng}xRtj|�D]A\}}	|	d	kr�|j|�q�|jdj	||	��q�Wdj	dj
|��}
t�}td|
�tj
dd	�t�}tjjj||�S(
u�
    Install packages using the pkgutil tool.

    CLI Example:

    .. code-block:: bash

        salt '*' pkg.install <package_name>
        salt '*' pkg.install SMClgcc346


    Multiple Package Installation Options:

    pkgs
        A list of packages to install from OpenCSW. Must be passed as a python
        list.

        CLI Example:

        .. code-block:: bash

            salt '*' pkg.install pkgs='["foo", "bar"]'
            salt '*' pkg.install pkgs='["foo", {"bar": "1.2.3"}]'


    Returns a dict containing the new package names and versions::

        {'<package>': {'old': '<old-version>',
                       'new': '<new-version>'}}
    upkg_resource.parse_targetsiiu{0}-{1}u/opt/csw/bin/pkgutil -yu {0}u ucmd.run_allu
pkg.list_pkgsN(RRRRRR<Rt	iteritemstappendRR8R$R%R&R
RRR'(
RRR3R=Rt
pkg_paramstexcttargetstparamtpkgverRR(R)((s8/usr/lib/python2.7/site-packages/salt/modules/pkgutil.pytinstall�s.

$		c
K@s�ytd||�d}Wntk
r<}t|��nXt�}g|D]}||krM|^qM}|suiSdjdj|��}td|�tjdd�t�}	t	j
jj||	�S(ud
    Remove a package and all its dependencies which are not in use by other
    packages.

    name
        The name of the package to be deleted.


    Multiple Package Options:

    pkgs
        A list of packages to delete. Must be passed as a python list. The
        ``name`` parameter will be ignored if this option is passed.

    .. versionadded:: 0.16.0


    Returns a dict containing the changes.

    CLI Example:

    .. code-block:: bash

        salt '*' pkg.remove <package name>
        salt '*' pkg.remove <package1>,<package2>,<package3>
        salt '*' pkg.remove pkgs='["foo", "bar"]'
    upkg_resource.parse_targetsiu/opt/csw/bin/pkgutil -yr {0}u ucmd.run_allu
pkg.list_pkgsN(
RRRR$RR8R%R&RR
RRR'(
RR=RRERFR(txRGRR)((s8/usr/lib/python2.7/site-packages/salt/modules/pkgutil.pytremove6s	%	cK@std|d|�S(u]
    Package purges are not supported, this function is identical to
    ``remove()``.

    name
        The name of the package to be deleted.


    Multiple Package Options:

    pkgs
        A list of packages to delete. Must be passed as a python list. The
        ``name`` parameter will be ignored if this option is passed.

    .. versionadded:: 0.16.0


    Returns a dict containing the changes.

    CLI Example:

    .. code-block:: bash

        salt '*' pkg.purge <package name>
        salt '*' pkg.purge <package1>,<package2>,<package3>
        salt '*' pkg.purge pkgs='["foo", "bar"]'
    RR=(RL(RR=R((s8/usr/lib/python2.7/site-packages/salt/modules/pkgutil.pytpurgebs(#t__doc__t
__future__RRRR,tsalt.utils.dataR
tsalt.utils.functoolstsalt.utils.pkgtsalt.utils.versionstsalt.exceptionsRRtsalt.extRRR	RRR7R#R*RR$R3RBRt	functoolstalias_functiontavailable_versionRRJRLRM(((s8/usr/lib/python2.7/site-packages/salt/modules/pkgutil.pyt<module>
s*	
		/	
	6>,

Zerion Mini Shell 1.0