%PDF- %PDF-
| Direktori : /proc/self/root/proc/3522530/root/usr/lib/python2.7/site-packages/salt/states/ |
| Current File : //proc/self/root/proc/3522530/root/usr/lib/python2.7/site-packages/salt/states/cabal.pyc |
�
���^c @@ s~ d Z d d l m Z m Z m Z d d l m Z m Z d d l Z d � Z
d � Z d d e
d d � Z d d d � Z d S( u-
Installation of Cabal Packages
==============================
.. versionadded:: 2015.8.0
These states manage the installed packages for Haskell using
cabal. Note that cabal-install must be installed for these states to
be available, so cabal states should include a requisite to a
pkg.installed state for the package which provides cabal
(``cabal-install`` in case of Debian based distributions). Example::
.. code-block:: yaml
cabal-install:
pkg.installed
ShellCheck:
cabal.installed:
- require:
- pkg: cabal-install
i ( t absolute_importt print_functiont unicode_literals( t CommandExecutionErrort CommandNotFoundErrorNc C@ s4 t j j j d � d k o3 t j j j d � d k S( u4
Only work when cabal-install is installed.
u cabalu ghc-pkgN( t saltt utilst patht whicht None( ( ( s5 /usr/lib/python2.7/site-packages/salt/states/cabal.pyt __virtual__ s c C@ s1 | j d � \ } } } | j � | | j � f S( u=
Parse pkg string and return a tuple of package name, separator, and
package version.
Cabal support install package with following format:
* foo-1.0
* foo < 1.2
* foo > 1.3
For the sake of simplicity only the first form is supported,
support for other forms can be added later.
u -( t partitiont strip( t pkgt pkg_namet separatort pkg_ver( ( s5 /usr/lib/python2.7/site-packages/salt/states/cabal.pyt _parse_pkg_string( s c C@ s@ i | d 6d d 6d d 6i d 6} y t d d | d | � } Wn7 t t f k
rx } t | d <d j | � | d <| SX| d k r� | } n | g } y# t d
d | d t d | � } Wn: t t f k
r� } t | d <d j | | � | d <| SXg }
g } x� | D]z } t | � \ }
} } |
| k rA| j | � q
| rw| |
| k rg| j | � q�|
j | � q
|
j | � q
Wt d
rd | d <g } | r�| j d j d j
| � � � n |
r�| j d j d j
| � d j
|
� � � n d j
| � | d <| S| sQt | d <d j d j
| � d j
|
� � | d <| Sy) t d d | d | d | d | � } WnC t t f k
r�} t | d <d j d j
| � | � | d <| SX| rt | t � rt | d <i g d 6| d 6| d <d j d j
| � � | d <n&